feat(http2): Add window size config options for Client and Server

Add `fn http2_initial_stream_window_size` and `fn
http2_initial_connection_window_size` for client and server.

Closes #1771
This commit is contained in:
Kevin Leimkuhler
2019-03-01 14:44:38 -08:00
committed by Sean McArthur
parent 2114950cda
commit 7dcd4618c0
5 changed files with 93 additions and 6 deletions

View File

@@ -302,6 +302,25 @@ impl<I, E> Builder<I, E> {
self
}
/// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2
/// stream-level flow control.
///
/// Default is 65,535
///
/// [spec]: https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE
pub fn http2_initial_stream_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
self.protocol.http2_initial_stream_window_size(sz.into());
self
}
/// Sets the max connection-level flow control for HTTP2
///
/// Default is 65,535
pub fn http2_initial_connection_window_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
self.protocol.http2_initial_connection_window_size(sz.into());
self
}
/// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2
/// connections.
///