mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-25 04:47:50 +00:00
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:
1 parent
1138881931
commit
55daa4cd4e
9 files changed
+155
-8
No files matched your search
@@ -33,7 +33,7 @@ public struct StreamClosedEvent {
|
||||
}
|
||||
}
|
||||
|
||||
extension StreamClosedEvent: Equatable { }
|
||||
extension StreamClosedEvent: Hashable { }
|
||||
|
||||
|
||||
/// A `NIOHTTP2WindowUpdatedEvent` is fired whenever a flow control window is changed.
|
||||
@@ -63,7 +63,7 @@ public struct NIOHTTP2WindowUpdatedEvent {
|
||||
}
|
||||
}
|
||||
|
||||
extension NIOHTTP2WindowUpdatedEvent: Equatable { }
|
||||
extension NIOHTTP2WindowUpdatedEvent: Hashable { }
|
||||
|
||||
|
||||
/// A `NIOHTTP2StreamCreatedEvent` is fired whenever a HTTP/2 stream is created.
|
||||
@@ -83,4 +83,19 @@ public struct NIOHTTP2StreamCreatedEvent {
|
||||
}
|
||||
}
|
||||
|
||||
extension NIOHTTP2StreamCreatedEvent: Equatable { }
|
||||
extension NIOHTTP2StreamCreatedEvent: Hashable { }
|
||||
|
||||
/// A `NIOHTTP2BulkStreamWindowChangeEvent` is fired whenever all of the remote flow control windows for a given stream have been changed.
|
||||
///
|
||||
/// This occurs when an ACK to a SETTINGS frame is received that changes the value of SETTINGS_INITIAL_WINDOW_SIZE. This is only fired
|
||||
/// when the local peer has changed its settings.
|
||||
public struct NIOHTTP2BulkStreamWindowChangeEvent {
|
||||
/// The change in the remote stream window sizes.
|
||||
public let delta: Int
|
||||
|
||||
public init(delta: Int) {
|
||||
self.delta = delta
|
||||
}
|
||||
}
|
||||
|
||||
extension NIOHTTP2BulkStreamWindowChangeEvent: Hashable { }
|
||||
Reference in new issue
Block a user