Bump seen counters
This commit is contained in:
parent
fd17ddc46b
commit
91873ed287
1 changed files with 3 additions and 4 deletions
|
|
@ -91,7 +91,7 @@ use crate::{
|
||||||
},
|
},
|
||||||
session::CheckedIncomingConnection,
|
session::CheckedIncomingConnection,
|
||||||
spawn_utils::spawn,
|
spawn_utils::spawn,
|
||||||
torrent_state::peer::Peer,
|
torrent_state::{peer::Peer, utils::atomic_inc},
|
||||||
tracker_comms::{TrackerError, TrackerRequest, TrackerRequestEvent, TrackerResponse},
|
tracker_comms::{TrackerError, TrackerRequest, TrackerRequestEvent, TrackerResponse},
|
||||||
type_aliases::{PeerHandle, BF},
|
type_aliases::{PeerHandle, BF},
|
||||||
};
|
};
|
||||||
|
|
@ -394,6 +394,7 @@ impl TorrentStateLive {
|
||||||
peer.stats.counters.clone()
|
peer.stats.counters.clone()
|
||||||
}
|
}
|
||||||
Entry::Vacant(vac) => {
|
Entry::Vacant(vac) => {
|
||||||
|
atomic_inc(&self.peers.stats.seen);
|
||||||
let peer = Peer::new_live_for_incoming_connection(
|
let peer = Peer::new_live_for_incoming_connection(
|
||||||
Id20(checked_peer.handshake.peer_id),
|
Id20(checked_peer.handshake.peer_id),
|
||||||
tx.clone(),
|
tx.clone(),
|
||||||
|
|
@ -404,9 +405,7 @@ impl TorrentStateLive {
|
||||||
counters
|
counters
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
counters
|
atomic_inc(&counters.incoming_connections);
|
||||||
.incoming_connections
|
|
||||||
.fetch_add(1, Ordering::Relaxed);
|
|
||||||
|
|
||||||
self.spawn(
|
self.spawn(
|
||||||
"incoming peer",
|
"incoming peer",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue