Skip to content

Commit

Permalink
Avoid spurios wakups when sent capacity doesn't change
Browse files Browse the repository at this point in the history
Fixes #628
  • Loading branch information
vadim-eg committed Jul 28, 2022
1 parent 756384f commit 01cea3d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/proto/streams/prioritize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,12 @@ impl Prioritize {
stream.buffered_send_data -= len as usize;
stream.requested_send_capacity -= len;

// If the capacity was limited because of the
// max_send_buffer_size, then consider waking
// the send task again...
stream.notify_if_can_buffer_more(self.max_buffer_size);

if stream_capacity > self.max_buffer_size {
// If the capacity was limited because of the
// max_send_buffer_size, then consider waking
// the send task again...
stream.notify_if_can_buffer_more(self.max_buffer_size);
}
// Assign the capacity back to the connection that
// was just consumed from the stream in the previous
// line.
Expand Down

0 comments on commit 01cea3d

Please sign in to comment.