From 1c3be72aab2e0267f2ee09128abd8136b159dd4c Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Sat, 13 Jan 2024 18:02:52 +0900 Subject: [PATCH] feat(http2): add `initial_max_send_streams` method to client builder --- src/client/legacy/client.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index 6043f02..8022055 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -1291,6 +1291,26 @@ impl Builder { self } + /// Sets the initial maximum of locally initiated (send) streams. + /// + /// This value will be overwritten by the value included in the initial + /// SETTINGS frame received from the peer as part of a [connection preface]. + /// + /// Passing `None` will do nothing. + /// + /// If not set, hyper will use a default. + /// + /// [connection preface]: https://httpwg.org/specs/rfc9113.html#preface + #[cfg(feature = "http2")] + #[cfg_attr(docsrs, doc(cfg(feature = "http2")))] + pub fn http2_initial_max_send_streams( + &mut self, + initial: impl Into>, + ) -> &mut Self { + self.h2_builder.initial_max_send_streams(initial); + self + } + /// Sets whether to use an adaptive flow control. /// /// Enabling this will override the limits set in