Skip to content

Commit cadb5f6

Browse files
allan2ikrivosheev
authored andcommitted
Add max_pending_accept_reset_streams
This function was in 0.14 but missed in 1.0. The original function was merged [here](https://github.com/hyperium/hyper/pull/3201/files/e8296d1c5bded88a508f1ca1f35791c30803182d) This commit simply copies directly from it. The config part has been merged into hyper 1.0 (hyperium/hyper#3507). This commit completes the re-addition of this missing function.
1 parent 62ceda7 commit cadb5f6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tower-service ={ version = "0.3", optional = true }
3131
tower = { version = "0.4.1", optional = true, features = ["make", "util"] }
3232

3333
[dev-dependencies]
34-
hyper = { version = "1.1.0", features = ["full"] }
34+
hyper = { version = "1.2.0", features = ["full"] }
3535
bytes = "1"
3636
http-body-util = "0.1.0"
3737
tokio = { version = "1", features = ["macros", "test-util"] }
@@ -75,3 +75,4 @@ __internal_happy_eyeballs_tests = []
7575
[[example]]
7676
name = "client"
7777
required-features = ["client-legacy", "http1", "tokio"]
78+

src/server/conn/auto.rs

+11
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,17 @@ impl<E> Http2Builder<'_, E> {
661661
Http1Builder { inner: self.inner }
662662
}
663663

664+
/// Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
665+
///
666+
/// This will default to the default value set by the [`h2` crate](https://crates.io/crates/h2).
667+
/// As of v0.4.0, it is 20.
668+
///
669+
/// See <https://github.com/hyperium/hyper/issues/2877> for more information.
670+
pub fn max_pending_accept_reset_streams(&mut self, max: impl Into<Option<usize>>) -> &mut Self {
671+
self.inner.http2.max_pending_accept_reset_streams(max);
672+
self
673+
}
674+
664675
/// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2
665676
/// stream-level flow control.
666677
///

0 commit comments

Comments
 (0)