Skip to content

Commit

Permalink
Flushing a closed stream is okay
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed May 19, 2023
1 parent 76a7e6f commit 6c03282
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yamux/src/connection/stream.rs
Expand Up @@ -363,6 +363,10 @@ impl AsyncWrite for Stream {
}

fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<io::Result<()>> {
if self.is_closed() {
return Poll::Ready(Ok(()));
}

let num_frames = {
let shared = self.shared();

Expand Down

0 comments on commit 6c03282

Please sign in to comment.