From 4e802638412c9e5f393e6bed7b85f7f6f93ec549 Mon Sep 17 00:00:00 2001 From: KOVACS Krisztian Date: Fri, 7 Jun 2024 19:06:28 +0200 Subject: [PATCH] fix: wake up readers after setting the state to RecvClosed (#190) Readers should be woken up after setting the state to RecvClosed otherwise they potentially miss reading the EOF entirely. --- yamux/src/connection.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yamux/src/connection.rs b/yamux/src/connection.rs index 1c87336..24c53c7 100644 --- a/yamux/src/connection.rs +++ b/yamux/src/connection.rs @@ -728,6 +728,10 @@ impl Active { 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()