mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Fix use of StreamReadable
: Ensure no empty Bytes
(#799)
which would cause the `StreamReadable` to return eof even if the underlying stream is still open and has not sent EOF yet. Fixed #777 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
9635e05d6c
commit
1e49460ac7
1 changed files with 4 additions and 0 deletions
|
@ -96,6 +96,10 @@ where
|
||||||
try_join(
|
try_join(
|
||||||
async move {
|
async move {
|
||||||
while let Some(bytes) = stream.next().await.transpose()? {
|
while let Some(bytes) = stream.next().await.transpose()? {
|
||||||
|
if bytes.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if tx.send(bytes).await.is_err() {
|
if tx.send(bytes).await.is_err() {
|
||||||
// The extract tar returns, which could be that:
|
// The extract tar returns, which could be that:
|
||||||
// - Extraction fails with an error
|
// - Extraction fails with an error
|
||||||
|
|
Loading…
Add table
Reference in a new issue