mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 18:33:24 +00:00
Make connection addition and deletion in order
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
a7e718e812
commit
240192f735
@ -286,14 +286,13 @@ impl<E: Ext> SocketTable<E> {
|
||||
&mut self.connection_buckets[bucket_index as usize]
|
||||
};
|
||||
|
||||
if let Some(index) = bucket
|
||||
let index = bucket
|
||||
.connections
|
||||
.iter()
|
||||
.position(|tcp_connection| tcp_connection.connection_key() == key)
|
||||
{
|
||||
let connection = bucket.connections.swap_remove(index);
|
||||
connection.on_dead_events();
|
||||
}
|
||||
.unwrap();
|
||||
let connection = bucket.connections.swap_remove(index);
|
||||
connection.on_dead_events();
|
||||
}
|
||||
|
||||
pub(crate) fn remove_udp_socket(
|
||||
|
Reference in New Issue
Block a user