Skip to content

Commit f4a85a4

Browse files
committed
feat(client): add http2_max_local_error_reset_streams method to legacy client
Expose the h2 `max_local_error_reset_streams` setting on the legacy client builder, allowing users to configure the maximum number of local resets due to protocol errors.
1 parent 8ae9e8b commit f4a85a4

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/client/legacy/client.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,24 @@ impl Builder {
15121512
self
15131513
}
15141514

1515+
/// Configures the maximum number of local resets due to protocol errors made by the remote end.
1516+
///
1517+
/// See the documentation of [`h2::client::Builder::max_local_error_reset_streams`] for more
1518+
/// details.
1519+
///
1520+
/// The default value is determined by the `h2` crate.
1521+
///
1522+
/// [`h2::client::Builder::max_local_error_reset_streams`]: https://docs.rs/h2/latest/h2/client/struct.Builder.html#method.max_local_error_reset_streams
1523+
#[cfg(feature = "http2")]
1524+
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
1525+
pub fn http2_max_local_error_reset_streams(
1526+
&mut self,
1527+
max: impl Into<Option<usize>>,
1528+
) -> &mut Self {
1529+
self.h2_builder.max_local_error_reset_streams(max);
1530+
self
1531+
}
1532+
15151533
/// Sets the `SETTINGS_MAX_CONCURRENT_STREAMS` option for HTTP2 connections.
15161534
///
15171535
/// Passing `None` will do nothing.

0 commit comments

Comments
 (0)