diff --git a/src/client/mod.rs b/src/client/mod.rs index f0ccb0eb57..71b2046e8b 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -1040,6 +1040,16 @@ 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>) -> &mut Self { + self.conn_builder.http2_max_frame_size(sz); + self + } + /// Sets an interval for HTTP2 Ping frames should be sent to keep a /// connection alive. /// diff --git a/src/server/mod.rs b/src/server/mod.rs index a57eaebbf4..0a00dae54d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -342,6 +342,16 @@ 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>) -> Self { + self.protocol.http2_max_frame_size(sz); + self + } + /// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2 /// connections. ///