Skip to content

Commit

Permalink
Fix use of StreamReadable: Ensure no empty Bytes (#799)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NobodyXu authored Feb 15, 2023
1 parent 9635e05 commit 1e49460
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/binstalk-downloader/src/download/async_extracter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ where
try_join(
async move {
while let Some(bytes) = stream.next().await.transpose()? {
if bytes.is_empty() {
continue;
}

if tx.send(bytes).await.is_err() {
// The extract tar returns, which could be that:
// - Extraction fails with an error
Expand Down

0 comments on commit 1e49460

Please sign in to comment.