Skip to content

Commit

Permalink
Break npk stream upon io errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flxo committed Apr 27, 2022
1 parent 6c634b7 commit 87b82be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion northstar/src/runtime/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ where

// If the connections breaks: just break. If the receiver is dropped: just break.
let mut take = ReaderStream::with_capacity(stream.get_mut().take(size), 1024 * 1024);
while let Some(Ok(buf)) = take.next().await {
while let Some(buf) = take.next().await {
let buf = buf.map_err(|e| Error::Io("npk stream".into(), e))?;
// Ignore any sending error because the stream needs to be drained for `size` bytes.
tx.send(buf).await.ok();
}
Expand Down

0 comments on commit 87b82be

Please sign in to comment.