Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Jul 10, 2024
1 parent 151e802 commit 5a1f659
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neqo-transport/src/pmtud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Pmtud {
.search_table
.iter()
.position(|&sz| sz > max_len + self.header_size)
.unwrap_or(self.search_table.len());
.unwrap_or(SEARCH_TABLE_LEN);
self.loss_counts.iter_mut().take(idx).for_each(|c| *c = 0);

let acked = self.count_probes(acked_pkts);
Expand Down Expand Up @@ -304,7 +304,7 @@ impl Pmtud {

/// Starts the next upward PMTUD probe.
pub fn start(&mut self) {
if self.probe_index < self.search_table.len() - 1 {
if self.probe_index < SEARCH_TABLE_LEN - 1 {
self.probe_state = Probe::Needed; // We need to send a probe
self.probe_count = 0; // For the first time
self.probe_index += 1; // At this size
Expand Down Expand Up @@ -367,7 +367,7 @@ mod tests {
.position(|x| *x == pmtud.mtu)
.unwrap();
assert!(mtu >= pmtud.search_table[idx]);
if idx < pmtud.search_table.len() - 1 {
if idx < SEARCH_TABLE_LEN - 1 {
assert!(mtu < pmtud.search_table[idx + 1]);
}
}
Expand Down

0 comments on commit 5a1f659

Please sign in to comment.