Various small comments and fixes

This commit is contained in:
Joakim Frostegård 2020-04-05 04:43:13 +02:00
parent 15b0c17d92
commit 35bf89f2ed
3 changed files with 3 additions and 8 deletions

View file

@ -3,6 +3,7 @@
* Configuration, cli
* Tests
* Benchmarks (with criterion?)
* Clean connections: `state.connections.shrink_to_fit()`?
## Don't do

View file

@ -100,9 +100,7 @@ pub fn handle_announce_requests(
let response = Response::Announce(AnnounceResponse {
transaction_id: request.transaction_id,
announce_interval: AnnounceInterval(
600 // config.announce_interval as i32
),
announce_interval: AnnounceInterval(600), // 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

View file

@ -86,7 +86,7 @@ pub fn run_event_loop(
Ok((amt, src)) => {
let request = request_from_bytes(
&buffer[..amt],
255u8
255u8 // FIXME
);
match request {
@ -111,8 +111,6 @@ pub fn run_event_loop(
},
err => {
eprintln!("recv_from error: {:?}", err);
break;
}
}
}
@ -148,8 +146,6 @@ pub fn run_event_loop(
},
err => {
eprintln!("send_to error: {:?}", err);
break;
}
}
}