From 679d8f9fd4b79c6148240b4eff149ee8dac6a8ff Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Wed, 17 Feb 2021 16:56:46 +0000 Subject: [PATCH] Update congestion_blocked function for multiple datagrams With GSO we need to be able to check whether multiple datagrams are sendable. --- quinn-proto/src/connection/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 19fd75980..a2832513a 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -434,7 +434,7 @@ where ack_eliciting |= self.can_send_1rtt(); // Tail loss probes must not be blocked by congestion, or a deadlock could arise if ack_eliciting && self.spaces[space_id].loss_probes == 0 { - if self.congestion_blocked() { + if self.congestion_blocked(u64::from(self.path.mtu)) { congestion_blocked = true; continue; } @@ -2993,8 +2993,8 @@ where } /// Whether UDP transmits are currently blocked by link congestion - fn congestion_blocked(&self) -> bool { - self.in_flight.bytes + u64::from(self.path.mtu) >= self.path.congestion.window() + fn congestion_blocked(&self, bytes_to_send: u64) -> bool { + self.in_flight.bytes + bytes_to_send >= self.path.congestion.window() } fn decrypt_packet(