Skip to content

Commit 5655b0c

Browse files
committed
feat(http2): configure HTTP/2 frame size in the high-level builders too
Oops, I missed this in hyperium#2211.
1 parent b6fb18a commit 5655b0c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/client/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,16 @@ impl Builder {
10401040
self
10411041
}
10421042

1043+
/// Sets the maximum frame size to use for HTTP2.
1044+
///
1045+
/// Passing `None` will do nothing.
1046+
///
1047+
/// If not set, hyper will use a default.
1048+
pub fn http2_max_frame_size(&mut self, sz: impl Into<Option<u32>>) -> &mut Self {
1049+
self.conn_builder.http2_max_frame_size(sz);
1050+
self
1051+
}
1052+
10431053
/// Sets an interval for HTTP2 Ping frames should be sent to keep a
10441054
/// connection alive.
10451055
///

src/server/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,16 @@ impl<I, E> Builder<I, E> {
342342
self
343343
}
344344

345+
/// Sets the maximum frame size to use for HTTP2.
346+
///
347+
/// Passing `None` will do nothing.
348+
///
349+
/// If not set, hyper will use a default.
350+
pub fn http2_max_frame_size(mut self, sz: impl Into<Option<u32>>) -> Self {
351+
self.protocol.http2_max_frame_size(sz);
352+
self
353+
}
354+
345355
/// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2
346356
/// connections.
347357
///

0 commit comments

Comments
 (0)