feat(http2): allow configuring the HTTP/2 frame size

The default of 16K is taken from h2.
This commit is contained in:
Geoffry Song
2020-05-28 16:07:31 -07:00
committed by Sean McArthur
parent 042c770603
commit b64464562a
4 changed files with 33 additions and 1 deletions

View File

@@ -309,6 +309,18 @@ impl<E> Http<E> {
self
}
/// Sets the maximum frame size to use for HTTP2.
///
/// Passing `None` will do nothing.
///
/// If not set, hyper will use a default.
pub fn http2_max_frame_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
if let Some(sz) = sz.into() {
self.h2_builder.max_frame_size = sz;
}
self
}
/// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2
/// connections.
///