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
11 changes: 11 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,17 @@ where
self.inner.take_user_pings().map(PingPong::new)
}

/// Returns whether the initial `SETTINGS` frame from the server peer has
/// been received and applied.
///
/// Until then, [`max_concurrent_send_streams`][Self::max_concurrent_send_streams]
/// reflects the locally configured
/// [`initial_max_send_streams`][Builder::initial_max_send_streams] rather
/// than the server's limit.
pub fn has_received_initial_settings(&self) -> bool {
self.inner.has_received_remote_initial_settings()
}

/// Returns the maximum number of concurrent streams that may be initiated
/// by this client.
///
Expand Down
6 changes: 6 additions & 0 deletions src/proto/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ where
self.inner.settings.send_settings(settings)
}

/// Returns whether the initial SETTINGS frame from the remote peer has
/// been received and applied.
pub(crate) fn has_received_remote_initial_settings(&self) -> bool {
self.inner.settings.has_received_remote_initial_settings()
}

/// Returns the maximum number of concurrent streams that may be initiated
/// by this peer.
pub(crate) fn max_send_streams(&self) -> usize {
Expand Down
6 changes: 6 additions & 0 deletions src/proto/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ impl Settings {
}
}

/// Returns `true` once the initial SETTINGS frame from the remote peer
/// has been received and applied.
pub(crate) fn has_received_remote_initial_settings(&self) -> bool {
self.has_received_remote_initial_settings
}

/// Sets `true` to `self.has_received_remote_initial_settings`.
/// Returns `true` if this method is called for the first time.
/// (i.e. it is the initial SETTINGS frame from the remote peer)
Expand Down