diff --git a/quinn-proto/src/connection/streams/recv.rs b/quinn-proto/src/connection/streams/recv.rs index 509148039..d968fd4e4 100644 --- a/quinn-proto/src/connection/streams/recv.rs +++ b/quinn-proto/src/connection/streams/recv.rs @@ -107,7 +107,8 @@ impl Recv { // smaller than `stream_receive_window` in order to make sure the stream // does not get stuck. let diff = max_stream_data - self.sent_max_stream_data; - let transmit = self.receiving_unknown_size() && diff >= (stream_receive_window / 8); + let transmit = + self.receiving_unknown_size() && !self.stopped && diff >= (stream_receive_window / 8); (max_stream_data, ShouldTransmit(transmit)) } diff --git a/quinn-proto/src/connection/streams/state.rs b/quinn-proto/src/connection/streams/state.rs index c71a7e728..21d585a63 100644 --- a/quinn-proto/src/connection/streams/state.rs +++ b/quinn-proto/src/connection/streams/state.rs @@ -358,7 +358,7 @@ impl StreamsState { self.recv .get(&id) .and_then(|s| s.as_ref()) - .map_or(false, |s| s.receiving_unknown_size()) + .map_or(false, |s| s.receiving_unknown_size() && !s.stopped) } pub(in crate::connection) fn write_control_frames( @@ -446,7 +446,7 @@ impl StreamsState { Some(x) => x, None => continue, }; - if !rs.receiving_unknown_size() { + if !rs.receiving_unknown_size() || rs.stopped { continue; } retransmits.get_or_create().max_stream_data.insert(id);