Skip to content

Commit

Permalink
feat: adds max_pending_accept_reset_streams for legacy (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
allan2 authored Apr 25, 2024
1 parent a77d866 commit 5688b27
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/client/legacy/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,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 <https://github.com/hyperium/hyper/issues/2877> 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<Option<usize>>,
) -> &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.
///
Expand Down

1 comment on commit 5688b27

@czy-29
Copy link

@czy-29 czy-29 commented on 5688b27 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you need to update the hyper dependency in Cargo.toml to 1.3.x, because hyper::client::conn::http2::Builder in 1.2.x does not have the max_pending_accept_reset_streams method.

Please sign in to comment.