Skip to content

Commit

Permalink
fix: wake up readers after setting the state to RecvClosed (#190)
Browse files Browse the repository at this point in the history
Readers should be woken up after setting the state to RecvClosed otherwise
they potentially miss reading the EOF entirely.
  • Loading branch information
kkovaacs authored Jun 7, 2024
1 parent 5709e1b commit 4e80263
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yamux/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ impl<T: AsyncRead + AsyncWrite + Unpin> Active<T> {
shared.increase_send_window_by(frame.header().credit());
if is_finish {
shared.update_state(self.id, stream_id, State::RecvClosed);

if let Some(w) = shared.reader.take() {
w.wake()
}
}
if let Some(w) = shared.writer.take() {
w.wake()
Expand Down

0 comments on commit 4e80263

Please sign in to comment.