From 808318e65bc4e07e01eb34ff15ed0aaf4f922805 Mon Sep 17 00:00:00 2001 From: Allan Zhang Date: Thu, 29 Feb 2024 01:48:08 -0500 Subject: [PATCH 1/2] Adds `max_pending_accept_reset_streams` for legacy Adds this missing function to the legacy client. --- src/client/legacy/client.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index 8022055..02e8bdb 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -1261,6 +1261,22 @@ impl Builder { self } + /// Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent. + /// + /// This will default to the default value set by the [`h2` crate](https://crates.io/crates/h2). + /// As of v0.4.0, it is 20. + /// + /// See for more information. + #[cfg(feature = "http2")] + #[cfg_attr(docsrs, doc(cfg(feature = "http2")))] + pub fn http2_max_pending_accept_reset_streams( + &mut self, + max: impl Into>, + ) -> &mut Self { + self.h2_builder.max_pending_accept_reset_streams = max.into(); + self + } + /// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2 /// stream-level flow control. /// From b9afe2e8c17126561e282e7497ec055bf95789a9 Mon Sep 17 00:00:00 2001 From: tison Date: Wed, 24 Apr 2024 23:01:15 +0800 Subject: [PATCH 2/2] fix compilation Signed-off-by: tison --- src/client/legacy/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index 520f48b..0e2cae0 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -1300,7 +1300,7 @@ impl Builder { &mut self, max: impl Into>, ) -> &mut Self { - self.h2_builder.max_pending_accept_reset_streams = max.into(); + self.h2_builder.max_pending_accept_reset_streams(max.into()); self }