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 * Configuration, cli
* Tests * Tests
* Benchmarks (with criterion?) * Benchmarks (with criterion?)
* Clean connections: `state.connections.shrink_to_fit()`?
## Don't do ## Don't do

View file

@ -100,9 +100,7 @@ pub fn handle_announce_requests(
let response = Response::Announce(AnnounceResponse { let response = Response::Announce(AnnounceResponse {
transaction_id: request.transaction_id, transaction_id: request.transaction_id,
announce_interval: AnnounceInterval( announce_interval: AnnounceInterval(600), // FIXME
600 // config.announce_interval as i32
),
leechers: NumberOfPeers(torrent_data.num_leechers.load(Ordering::SeqCst) as i32), leechers: NumberOfPeers(torrent_data.num_leechers.load(Ordering::SeqCst) as i32),
seeders: NumberOfPeers(torrent_data.num_seeders.load(Ordering::SeqCst) as i32), seeders: NumberOfPeers(torrent_data.num_seeders.load(Ordering::SeqCst) as i32),
peers: response_peers peers: response_peers

View file

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