aquatic_ws: announce handler: update comments

This commit is contained in:
Joakim Frostegård 2020-05-08 02:15:14 +02:00
parent 982f3c8959
commit fa82d93190

View file

@ -80,6 +80,8 @@ pub fn handle_announce_requests(
let torrent_data = torrents.entry(request.info_hash) let torrent_data = torrents.entry(request.info_hash)
.or_default(); .or_default();
// TODO: insert peer, update stats etc
if let Some(offers) = request.offers { if let Some(offers) = request.offers {
// if offers are set, fetch same number of peers, send offers to all of them // if offers are set, fetch same number of peers, send offers to all of them
} }
@ -131,8 +133,7 @@ pub fn handle_scrape_requests(
}; };
// If request.info_hashes is None, don't return scrape for all // If request.info_hashes is None, don't return scrape for all
// torrents, even though that is done in reference server, it is // torrents, even though reference server does it. It is too expensive.
// too expensive.
if let Some(info_hashes) = request.info_hashes { if let Some(info_hashes) = request.info_hashes {
for info_hash in info_hashes { for info_hash in info_hashes {
if let Some(torrent_data) = torrents.get(&info_hash){ if let Some(torrent_data) = torrents.get(&info_hash){