mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic: add and use NetworkConfig.peer_announce_interval
This commit is contained in:
parent
ca9d15c7a9
commit
7239e9c047
2 changed files with 3 additions and 1 deletions
|
|
@ -15,6 +15,7 @@ pub struct Config {
|
|||
#[derive(Clone)]
|
||||
pub struct NetworkConfig {
|
||||
pub address: SocketAddr,
|
||||
pub peer_announce_interval: i32,
|
||||
pub recv_buffer_size: usize,
|
||||
pub poll_event_capacity: usize,
|
||||
}
|
||||
|
|
@ -52,6 +53,7 @@ impl Default for NetworkConfig {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
address: SocketAddr::from(([127, 0, 0, 1], 3000)),
|
||||
peer_announce_interval: 60 * 15,
|
||||
poll_event_capacity: 4096,
|
||||
recv_buffer_size: 4096 * 128,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ pub fn handle_announce_requests(
|
|||
|
||||
let response = Response::Announce(AnnounceResponse {
|
||||
transaction_id: request.transaction_id,
|
||||
announce_interval: AnnounceInterval(600), // FIXME
|
||||
announce_interval: AnnounceInterval(config.network.peer_announce_interval), // FIXME
|
||||
leechers: NumberOfPeers(torrent_data.num_leechers.load(Ordering::SeqCst) as i32),
|
||||
seeders: NumberOfPeers(torrent_data.num_seeders.load(Ordering::SeqCst) as i32),
|
||||
peers: response_peers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue