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

@@ -525,6 +525,18 @@ impl Builder {
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 an interval for HTTP2 Ping frames should be sent to keep a
/// connection alive.
///