diff --git a/src/proto/streams/flow_control.rs b/src/proto/streams/flow_control.rs index 521be38..fef8b47 100644 --- a/src/proto/streams/flow_control.rs +++ b/src/proto/streams/flow_control.rs @@ -48,7 +48,7 @@ impl FlowControl { } pub fn assign_capacity(&mut self, capacity: WindowSize) { - self.available + capacity; + self.available += capacity; } /// Returns the number of bytes available but not assigned to the window. diff --git a/tests/prioritization.rs b/tests/prioritization.rs index bc71834..d6fd1c9 100644 --- a/tests/prioritization.rs +++ b/tests/prioritization.rs @@ -35,7 +35,7 @@ fn single_stream_send_large_body() { let mut stream = h2.request(request, false).unwrap(); // Reserve capacity to send the payload - stream.reserve_capacity(payload.len()).unwrap(); + stream.reserve_capacity(payload.len()); // The capacity should be immediately allocated assert_eq!(stream.capacity(), payload.len()); @@ -88,7 +88,7 @@ fn single_stream_send_extra_large_body_multi_frames_one_buffer() { let mut stream = h2.request(request, false).unwrap(); - stream.reserve_capacity(payload.len()).unwrap(); + stream.reserve_capacity(payload.len()); // The capacity should be immediately allocated assert_eq!(stream.capacity(), payload.len()); @@ -153,7 +153,7 @@ fn single_stream_send_extra_large_body_multi_frames_multi_buffer() { let mut stream = h2.request(request, false).unwrap(); - stream.reserve_capacity(payload.len()).unwrap(); + stream.reserve_capacity(payload.len()); // The capacity should be immediately allocated assert_eq!(stream.capacity(), payload.len()); diff --git a/tests/stream_states.rs b/tests/stream_states.rs index ef37652..a5b2520 100644 --- a/tests/stream_states.rs +++ b/tests/stream_states.rs @@ -75,7 +75,7 @@ fn send_recv_data() { let mut stream = h2.request(request, false).unwrap(); // Reserve send capacity - stream.reserve_capacity(5).unwrap(); + stream.reserve_capacity(5); assert_eq!(stream.capacity(), 5);