Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Do not unwrap the oldest IP in QUIC connectiont table #26272

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,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