Skip to content

Commit

Permalink
Do not unwrap the oldest IP in QUIC connectiont table (solana-labs#26272
Browse files Browse the repository at this point in the history
) (solana-labs#26277)

(cherry picked from commit 31d870f)

Co-authored-by: Pankaj Garg <[email protected]>
  • Loading branch information
mergify[bot] and pgarg66 authored Jun 28, 2022
1 parent 972edc9 commit f1fabcb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,15 @@ impl ConnectionTable {
}
}
}
if let Some(removed) = self.table.remove(&oldest_ip.unwrap()) {
self.total_size -= removed.len();
num_pruned += removed.len();
if let Some(oldest_ip) = oldest_ip {
if let Some(removed) = self.table.remove(&oldest_ip) {
self.total_size -= removed.len();
num_pruned += removed.len();
}
} else {
// No valid entries in the table with an IP address. Continuing the loop will cause
// infinite looping.
break;
}
}
num_pruned
Expand Down

0 comments on commit f1fabcb

Please sign in to comment.