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 e51f848 commit 81d83a9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions quinn-proto/src/connection/spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,23 +633,23 @@ 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)) =
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
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 81d83a9

Please sign in to comment.