mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
aquatic_http: AnnounceRequest: make numwant optional, remove trackerid
This commit is contained in:
parent
6b7ce0e211
commit
2f2da8deb0
3 changed files with 17 additions and 14 deletions
|
|
@ -143,10 +143,9 @@ pub fn handle_announce_requests(
|
|||
}
|
||||
}
|
||||
|
||||
let max_num_peers_to_take = if request.numwant <= 0 {
|
||||
config.protocol.max_peers
|
||||
} else {
|
||||
request.numwant.min(config.protocol.max_peers)
|
||||
let max_num_peers_to_take = match request.numwant {
|
||||
Some(0) | None => config.protocol.max_peers,
|
||||
Some(numwant) => numwant.min(config.protocol.max_peers),
|
||||
};
|
||||
|
||||
let response_peers: Vec<ResponsePeer> = extract_response_peers(
|
||||
|
|
@ -161,7 +160,6 @@ pub fn handle_announce_requests(
|
|||
incomplete: torrent_data.num_leechers,
|
||||
announce_interval: config.protocol.peer_announce_interval,
|
||||
peers: response_peers,
|
||||
tracker_id: "".to_string()
|
||||
});
|
||||
|
||||
(request_sender_meta, response)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue