From 2354a7eec352b1f72cd8989d29d73dff211403a1 Mon Sep 17 00:00:00 2001 From: Geoffry Song Date: Tue, 2 Jun 2020 19:45:12 -0700 Subject: [PATCH] feat(http2): configure HTTP/2 frame size in the high-level builders too (#2214) Oops, I missed this in #2211. --- src/client/mod.rs | 10 ++++++++++ src/server/mod.rs | 10 ++++++++++ 2 files changed, 20 insertions(+) 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. ///