Skip to content

Commit 6c03282

Browse files
Flushing a closed stream is okay
1 parent 76a7e6f commit 6c03282

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

yamux/src/connection/stream.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ impl AsyncWrite for Stream {
363363
}
364364

365365
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<io::Result<()>> {
366+
if self.is_closed() {
367+
return Poll::Ready(Ok(()));
368+
}
369+
366370
let num_frames = {
367371
let shared = self.shared();
368372

0 commit comments

Comments
 (0)