Add ability to adjust INITIAL_WINDOW_SIZE setting on an existing connection (#421)
This commit is contained in:
@@ -1201,6 +1201,25 @@ where
|
||||
self.inner.set_target_window_size(size);
|
||||
}
|
||||
|
||||
/// Set a new `INITIAL_WINDOW_SIZE` setting (in octets) for stream-level
|
||||
/// flow control for received data.
|
||||
///
|
||||
/// The `SETTINGS` will be sent to the remote, and only applied once the
|
||||
/// remote acknowledges the change.
|
||||
///
|
||||
/// This can be used to increase or decrease the window size for existing
|
||||
/// streams.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if a previous call is still pending acknowledgement
|
||||
/// from the remote endpoint.
|
||||
pub fn set_initial_window_size(&mut self, size: u32) -> Result<(), crate::Error> {
|
||||
assert!(size <= proto::MAX_WINDOW_SIZE);
|
||||
self.inner.set_initial_window_size(size)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Takes a `PingPong` instance from the connection.
|
||||
///
|
||||
/// # Note
|
||||
|
||||
Reference in New Issue
Block a user