Skip to content

Commit

Permalink
Add max_pending_accept_reset_streams
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
allan2 authored and seanmonstar committed Feb 28, 2024
1 parent 1c3be72 commit 1c49c39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ __internal_happy_eyeballs_tests = []
[[example]]
name = "client"
required-features = ["client-legacy", "http1", "tokio"]

11 changes: 11 additions & 0 deletions src/server/conn/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,17 @@ impl<E> Http2Builder<'_, E> {
Http1Builder { inner: self.inner }
}

/// 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 <https://github.com/hyperium/hyper/issues/2877> for more information.
pub fn max_pending_accept_reset_streams(&mut self, max: impl Into<Option<usize>>) -> &mut Self {
self.inner.http2.max_pending_accept_reset_streams(max);
self
}

/// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2
/// stream-level flow control.
///
Expand Down

0 comments on commit 1c49c39

Please sign in to comment.