Correctly notify StreamMultiplexer of SETTINGS changes. (#67)

Motivation:

The StreamMultiplexer and StreamChannels are responsible for sending
WINDOW_UPDATE frames, but they were never told if the user changed the
value of SETTINGS_INITIAL_WINDOW_SIZE. They should be.

Modifications:

- Send user events when SETTINGS_INITIAL_WINDOW_SIZE changes.
- Use those window events to change the target window size in
    HTTP2StreamChannel.
- Keep track of the last stream window size we knew.

Result:

Less chance of flow control mess.
This commit is contained in:
Cory Benfield authored and GitHub committed 2019-03-15 17:37:00 +00:00
1 parent 1138881931
commit 55daa4cd4e
9 files changed
+155 -8

No files matched your search

@@ -464,6 +464,10 @@ extension NIOHTTP2Handler {
if settingsChange.streamWindowSizeChange != 0 {
self.outboundBuffer.initialWindowSizeChanged(settingsChange.streamWindowSizeChange)
}
case .localSettingsChanged(let settingsChange):
if settingsChange.streamWindowSizeChange != 0 {
self.inboundEventBuffer.pendingUserEvent(NIOHTTP2BulkStreamWindowChangeEvent(delta: settingsChange.streamWindowSizeChange))
}
}
}