reduce available window capacity when settings lowers window size

This commit is contained in:
Sean McArthur
2017-10-06 12:25:22 -07:00
parent 431442735d
commit 7b81be04aa
2 changed files with 68 additions and 10 deletions

View File

@@ -126,8 +126,10 @@ impl FlowControl {
/// This is called after receiving a SETTINGS frame with a lower
/// INITIAL_WINDOW_SIZE value.
pub fn dec_window(&mut self, sz: WindowSize) {
trace!("dec_window; sz={}; window={}, available={}", sz, self.window_size, self.available);
// This should not be able to overflow `window_size` from the bottom.
self.window_size -= sz as i32;
self.available = self.available.saturating_sub(sz);
}
/// Decrements the window reflecting data has actually been sent. The caller