Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ atomic-waker = { version = "1.1.2", optional = true }
futures-channel = { version = "0.3", optional = true }
futures-core = { version = "0.3.31", optional = true }
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
h2 = { version = "0.4.2", optional = true }
h2 = { version = "0.4.6", optional = true }
http-body-util = { version = "0.1", optional = true }
httparse = { version = "1.9", optional = true }
httpdate = { version = "1.0", optional = true }
Expand Down
20 changes: 20 additions & 0 deletions src/client/conn/http2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,26 @@ where
pub fn is_extended_connect_protocol_enabled(&self) -> bool {
self.inner.1.is_extended_connect_protocol_enabled()
}

/// Returns the current maximum send stream count.
///
/// This setting is configured in a [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][1] in a `SETTINGS` frame,
/// and may change throughout the connection lifetime.
///
/// [1]: https://datatracker.ietf.org/doc/html/rfc7540#section-5.1.2
pub fn current_max_send_streams(&self) -> usize {
self.inner.1.current_max_send_streams()
}

/// Returns the current maximum receive stream count.
///
/// This setting is configured in a [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][1] in a `SETTINGS` frame,
/// and may change throughout the connection lifetime.
///
/// [1]: https://datatracker.ietf.org/doc/html/rfc7540#section-5.1.2
pub fn current_max_recv_streams(&self) -> usize {
self.inner.1.current_max_recv_streams()
}
}

impl<T, B, E> fmt::Debug for Connection<T, B, E>
Expand Down
6 changes: 6 additions & 0 deletions src/proto/h2/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,12 @@ where
pub(crate) fn is_extended_connect_protocol_enabled(&self) -> bool {
self.h2_tx.is_extended_connect_protocol_enabled()
}
pub(crate) fn current_max_send_streams(&self) -> usize {
self.h2_tx.current_max_send_streams()
}
pub(crate) fn current_max_recv_streams(&self) -> usize {
self.h2_tx.current_max_recv_streams()
}
}

pin_project! {
Expand Down