Simpler and more precise ID flow control update check in Chunks

Bi-directional streams might not be freed immediately on reading to
end or receiving a reset, and `StreamsState::stream_freed` already
performs the exact accounting required for this case when we call it
on entering Finished or Reset state.
This commit is contained in:
Benjamin Saunders
2024-05-19 12:33:07 -07:00
parent 299425b324
commit d88e33b5ce
+3 -4
View File
@@ -313,10 +313,9 @@ impl<'a> Chunks<'a> {
let mut should_transmit = false;
// We issue additional stream ID credit after the application is notified that a previously
// open stream has finished or been reset and we've therefore disposed of its state.
if matches!(state, ChunksState::Finished | ChunksState::Reset(_))
&& self.streams.side != self.id.initiator()
{
// open stream has finished or been reset and we've therefore disposed of its state, as
// recorded by `stream_freed` calls in `next`.
if self.streams.take_max_streams_dirty(self.id.dir()) {
self.pending.max_stream_id[self.id.dir() as usize] = true;
should_transmit = true;
}