ws: SwarmControlMessage::ConnectionClosed: use Vec for info hashes

This commit is contained in:
Joakim Frostegård 2024-01-08 18:50:17 +01:00
parent 4c831643b1
commit 36954e5f48
3 changed files with 22 additions and 18 deletions

View file

@ -102,13 +102,14 @@ where
while let Some(message) = stream.next().await {
match message {
SwarmControlMessage::ConnectionClosed {
info_hash,
peer_id,
ip_version,
announced_info_hashes,
} => {
torrents
.borrow_mut()
.handle_connection_closed(info_hash, peer_id, ip_version);
let mut torrents = torrents.borrow_mut();
for (info_hash, peer_id) in announced_info_hashes {
torrents.handle_connection_closed(info_hash, peer_id, ip_version);
}
}
}
}