udp: if PeerStatus is Stopped, return empty peer list

This commit is contained in:
Joakim Frostegård 2022-09-25 11:50:21 +02:00
parent e5ffedc10c
commit ed98327e1a

View file

@ -157,8 +157,11 @@ fn handle_announce_request<I: Ip>(
peer_valid_until, peer_valid_until,
); );
let response_peers = let response_peers = if let PeerStatus::Stopped = peer_status {
torrent_data.extract_response_peers(rng, request.peer_id, max_num_peers_to_take); Vec::new()
} else {
torrent_data.extract_response_peers(rng, request.peer_id, max_num_peers_to_take)
};
AnnounceResponse { AnnounceResponse {
transaction_id: request.transaction_id, transaction_id: request.transaction_id,