mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_udp: move some config vars to new substruct, ProtocolConfig
This commit is contained in:
parent
5af9ae4ede
commit
840f67fc8d
4 changed files with 32 additions and 14 deletions
|
|
@ -260,7 +260,7 @@ pub fn handle_announce_requests(
|
|||
|
||||
let response = Response::Announce(AnnounceResponse {
|
||||
transaction_id: request.transaction_id,
|
||||
announce_interval: AnnounceInterval(config.network.peer_announce_interval),
|
||||
announce_interval: AnnounceInterval(config.protocol.peer_announce_interval),
|
||||
leechers: NumberOfPeers(torrent_data.num_leechers as i32),
|
||||
seeders: NumberOfPeers(torrent_data.num_seeders as i32),
|
||||
peers: response_peers
|
||||
|
|
@ -311,10 +311,10 @@ fn calc_max_num_peers_to_take(
|
|||
peers_wanted: i32,
|
||||
) -> usize {
|
||||
if peers_wanted <= 0 {
|
||||
config.network.max_response_peers as usize
|
||||
config.protocol.max_response_peers as usize
|
||||
} else {
|
||||
::std::cmp::min(
|
||||
config.network.max_response_peers as usize,
|
||||
config.protocol.max_response_peers as usize,
|
||||
peers_wanted as usize
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue