Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect total connection table size in the quic server when removing multiple connections with the same IP:Port #26073

Merged
Merged
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,13 @@ impl ConnectionTable {
fn remove_connection(&mut self, addr: &SocketAddr) {
if let Entry::Occupied(mut e) = self.table.entry(addr.ip()) {
let e_ref = e.get_mut();
let old_size = e_ref.len();
e_ref.retain(|connection| connection.port != addr.port());
let new_size = e_ref.len();
if e_ref.is_empty() {
e.remove_entry();
}
self.total_size -= 1;
self.total_size -= old_size - new_size;
ryleung-solana marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down