From 079211890b0e177a9f00f21f56f57dda05b448ce Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 30 Jul 2023 16:15:57 -0400 Subject: [PATCH] fix lru bug in connection table --- veilid-core/src/network_manager/connection_table.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/veilid-core/src/network_manager/connection_table.rs b/veilid-core/src/network_manager/connection_table.rs index 2ece5f05..eab8606e 100644 --- a/veilid-core/src/network_manager/connection_table.rs +++ b/veilid-core/src/network_manager/connection_table.rs @@ -177,10 +177,10 @@ impl ConnectionTable { // then drop the least recently used connection let mut out_conn = None; if inner.conn_by_id[protocol_index].len() > inner.max_connections[protocol_index] { - if let Some((lruk, lru_conn)) = inner.conn_by_id[protocol_index].remove_lru() { + if let Some((lruk, lru_conn)) = inner.conn_by_id[protocol_index].peek_lru() { log_net!(debug "connection lru out: {:?}", lru_conn); out_conn = Some(lru_conn); - Self::remove_connection_records(&mut *inner, lruk); + Self::remove_connection_records(&mut *inner, *lruk); } }