Skip to content

Commit 8ae9e8b

Browse files
authored
feat(client): add http2_header_table_size and http2_max_concurrent_streams methods to legacy client (#274)
Adds `http2_header_table_size` and `http2_max_concurrent_streams` methods to the client legacy `Builder`. Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
1 parent 6b3d2e8 commit 8ae9e8b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/client/legacy/client.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,18 @@ impl Builder {
14261426
self
14271427
}
14281428

1429+
/// Sets the header table size to use for HTTP2.
1430+
///
1431+
/// Passing `None` will do nothing.
1432+
///
1433+
/// If not set, hyper will use a default.
1434+
#[cfg(feature = "http2")]
1435+
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
1436+
pub fn http2_header_table_size(&mut self, size: impl Into<Option<u32>>) -> &mut Self {
1437+
self.h2_builder.header_table_size(size);
1438+
self
1439+
}
1440+
14291441
/// Sets an interval for HTTP2 Ping frames should be sent to keep a
14301442
/// connection alive.
14311443
///
@@ -1500,6 +1512,18 @@ impl Builder {
15001512
self
15011513
}
15021514

1515+
/// Sets the `SETTINGS_MAX_CONCURRENT_STREAMS` option for HTTP2 connections.
1516+
///
1517+
/// Passing `None` will do nothing.
1518+
///
1519+
/// The default value is determined by the `h2` crate.
1520+
#[cfg(feature = "http2")]
1521+
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
1522+
pub fn http2_max_concurrent_streams(&mut self, max: impl Into<Option<u32>>) -> &mut Self {
1523+
self.h2_builder.max_concurrent_streams(max);
1524+
self
1525+
}
1526+
15031527
/// Provide a timer to be used for h2
15041528
///
15051529
/// See the documentation of [`h2::client::Builder::timer`] for more

0 commit comments

Comments
 (0)