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:
Jiahao XU 2023-02-15 12:01:14 +11:00 committed by GitHub
parent 9635e05d6c
commit 1e49460ac7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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