Skip to content

Commit

Permalink
Reduce rightward drift
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Sep 24, 2023
1 parent b7f9c65 commit 2211976
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions quinn-proto/src/connection/spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,23 +633,17 @@ impl PendingAcks {
_ => {
// From acknowledgement frequency draft, section 6.1: send an ACK immediately if
// doing so would cause the sender to detect a new packet loss
if let Some((largest_acked, largest_unacked)) =
self.largest_acked.zip(self.largest_ack_eliciting_packet)
{
if self.reordering_threshold > largest_acked {
return false;
}
// The largest packet number that could be declared lost without a new ACK being
// sent
let largest_reported = largest_acked - self.reordering_threshold + 1;
dedup
.smallest_missing_in_interval(largest_reported, largest_unacked)
.map_or(false, |smallest_missing| {
largest_unacked - smallest_missing >= self.reordering_threshold
})
} else {
false
let Some((largest_acked, largest_unacked)) =
self.largest_acked.zip(self.largest_ack_eliciting_packet) else { return false; };
if self.reordering_threshold > largest_acked {
return false;
}
// The largest packet number that could be declared lost without a new ACK being
// sent
let largest_reported = largest_acked - self.reordering_threshold + 1;
let Some(smallest_missing_unreported) = dedup
.smallest_missing_in_interval(largest_reported, largest_unacked) else { return false; };
largest_unacked - smallest_missing_unreported >= self.reordering_threshold
}
}
}
Expand Down

0 comments on commit 2211976

Please sign in to comment.