mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: if PeerStatus is Stopped, return empty peer list
This commit is contained in:
parent
e5ffedc10c
commit
ed98327e1a
1 changed files with 5 additions and 2 deletions
|
|
@ -157,8 +157,11 @@ fn handle_announce_request<I: Ip>(
|
|||
peer_valid_until,
|
||||
);
|
||||
|
||||
let response_peers =
|
||||
torrent_data.extract_response_peers(rng, request.peer_id, max_num_peers_to_take);
|
||||
let response_peers = if let PeerStatus::Stopped = peer_status {
|
||||
Vec::new()
|
||||
} else {
|
||||
torrent_data.extract_response_peers(rng, request.peer_id, max_num_peers_to_take)
|
||||
};
|
||||
|
||||
AnnounceResponse {
|
||||
transaction_id: request.transaction_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue