From f28808b30c8e00f964deae91a1f33f5b84ccc666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Mon, 18 Oct 2021 23:23:27 +0200 Subject: [PATCH] aquatic_udp: add todo comments --- aquatic_udp/src/lib/glommio/handlers.rs | 3 ++- aquatic_udp/src/lib/glommio/network.rs | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/aquatic_udp/src/lib/glommio/handlers.rs b/aquatic_udp/src/lib/glommio/handlers.rs index 771f59b..2dc9763 100644 --- a/aquatic_udp/src/lib/glommio/handlers.rs +++ b/aquatic_udp/src/lib/glommio/handlers.rs @@ -21,10 +21,11 @@ pub fn run_request_worker( let mut rng = SmallRng::from_entropy(); + // Need to be cleaned periodically: use timer? let mut torrents_ipv4 = TorrentMap::::default(); let mut torrents_ipv6 = TorrentMap::::default(); - // Needs to be updated periodically + // Needs to be updated periodically: use timer? let peer_valid_until = ValidUntil::new(config.cleaning.max_peer_age); while let Some((request, addr)) = request_receiver.recv().await { diff --git a/aquatic_udp/src/lib/glommio/network.rs b/aquatic_udp/src/lib/glommio/network.rs index 1a934e7..1feb540 100644 --- a/aquatic_udp/src/lib/glommio/network.rs +++ b/aquatic_udp/src/lib/glommio/network.rs @@ -1,9 +1,7 @@ /// TODO -/// - move connection checks to socket workers -/// - ignore scrape requests. forward announce requests to request workers -/// sharded by info hash (with some nice algo to make it difficult for an -/// attacker to know which one they get forwarded to). this way, shared -/// state can be avoided. +/// - forward announce requests to request workers sharded by info hash (with +/// some nice algo to make it difficult for an attacker to know which one +/// they get forwarded to) use std::io::Cursor; use std::net::{IpAddr, SocketAddr}; use std::rc::Rc;