Skip to content

Commit

Permalink
Merge pull request #734 from saschagrunert/send-closed
Browse files Browse the repository at this point in the history
Send only streams data if channel is not closed
  • Loading branch information
openshift-merge-robot committed Sep 20, 2022
2 parents 18857bb + cac2758 commit 8e4cec9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions conmon-rs/server/src/container_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,11 @@ impl ContainerIO {
.await
.context("write to attach endpoints")?;

message_tx
.send(Message::Data(data.into(), pipe))
.context("send data message")?;
if !message_tx.is_closed() {
message_tx
.send(Message::Data(data.into(), pipe))
.context("send data message")?;
}
}
Err(e) => match Errno::from_i32(e.raw_os_error().context("get OS error")?) {
Errno::EIO => {
Expand Down

0 comments on commit 8e4cec9

Please sign in to comment.