When the application observes a stream finish or reset, we dispose of its state via StreamsState::stream_freed, and queue a transmit of stream flow control credit directly on the Connection. stream_freed however also sets StreamsState::max_streams_dirty, which is polled each time we receive a packet to see whether a stream has become fully closed due to an incoming frame. Together, these led to a MAX_STREAMS frame being transmit both immediately, and following the next packet receipt. We prevent that by unsetting the appropriate max_streams_dirty flags when sending MAX_STREAMS.
When the application observes a stream finish or reset, we dispose of its state via
StreamsState::stream_freed
, and queue a transmit of stream flow control credit directly on theConnection
.stream_freed
however also setsStreamsState::max_streams_dirty
, which is polled each time we receive a packet to see whether a stream has become fully closed due to an incoming frame. Together, these led to a MAX_STREAMS frame being transmit both immediately, and following the next packet receipt. We prevent that by unsetting the appropriatemax_streams_dirty
flags when sendingMAX_STREAMS
.