Skip to content

Commit 04cd398

Browse files
committed
cleanup
1 parent cf8f92e commit 04cd398

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

iroh-relay/src/server/clients.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ pub struct Clients(Arc<Inner>);
3333
struct Inner {
3434
/// The list of all currently connected clients.
3535
clients: DashMap<EndpointId, ClientState>,
36-
// /// List of clients that are still connected, but not active anymore
37-
// ///
38-
// /// Clients are moved here if another endpoint with the same id connects.
39-
// inactive_clients: DashMap<EndpointId, Vec<Client>>,
4036
/// Map of which client has sent where
4137
sent_to: DashMap<EndpointId, HashSet<EndpointId>>,
4238
/// Connection ID Counter
@@ -123,7 +119,6 @@ impl Clients {
123119
self.0.clients.remove_if_mut(&endpoint_id, |_id, state| {
124120
if state.active.connection_id() == connection_id {
125121
// The unregistering client is the currently active client
126-
let client = &state.active;
127122
if let Some(last_inactive_client) = state.inactive.pop() {
128123
// There is an inactive client, promote to active again.
129124
state.active = last_inactive_client;
@@ -133,7 +128,7 @@ impl Clients {
133128
// No inactive clients: Inform other peers that this peer is now gone.
134129
if let Some((_, sent_to)) = self.0.sent_to.remove(&endpoint_id) {
135130
for key in sent_to {
136-
match client.try_send_peer_gone(key) {
131+
match state.active.try_send_peer_gone(key) {
137132
Ok(_) => {}
138133
Err(TrySendError::Full(_)) => {
139134
debug!(

0 commit comments

Comments
 (0)