mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
Motivation: When a window update event is received in the stream channel we notify the inbound window manager. Doing so may emit a WINDOW_UPDATE frame to indicate the remote may send us more DATA. However, this happens even if there are inbound frames waiting to be delivered to the channel. This may lead to the remote sending us more DATA which we have to buffer until it is read. Modifications: - Update the inbound window manager to track the number of bytes buffered in the stream channel - Account for buffered bytes when receiving a new window size event - Possibly emit WINDOW_UPDATE after unbuffering inbound frames into the stream channel's pipeline Result: The timing of WINDOW_UPDATE frames is better aligned with when frames are actually read in a stream.