Skip to content

Commit

Permalink
Fix h2spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Oct 28, 2018
1 parent 2ce05f6 commit fd03305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/conn_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ where
// and the old value.
// TODO: check for overflow
s.out_window_size.0 += delta;
s.pump_out_window.increase(delta as usize);
s.pump_out_window.increase(delta as isize);
}

if !self.streams.map.is_empty() && delta > 0 {
Expand Down Expand Up @@ -313,7 +313,7 @@ where
stream
.stream()
.pump_out_window
.increase(frame.increment as usize);
.increase(frame.increment as isize);

Ok(Some(stream))
}
Expand Down
5 changes: 3 additions & 2 deletions src/common/window_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ impl ConnOutWindowSender {
}

impl StreamOutWindowSender {
pub fn increase(&self, size: usize) {
assert!(size <= isize::max_value() as usize);
/// `size` can be negative when INITIAL_WINDOW_SIZE
/// setting changes to lower value.
pub fn increase(&self, size: isize) {
let old_size = self
.shared
.window_size
Expand Down

0 comments on commit fd03305

Please sign in to comment.