mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
aquatic_ws: almost finish implementing access list support
This commit is contained in:
parent
db596b5038
commit
28cc6c261a
5 changed files with 88 additions and 36 deletions
|
|
@ -99,6 +99,19 @@ pub fn handle_announce_requests(
|
|||
let valid_until = ValidUntil::new(config.cleaning.max_peer_age);
|
||||
|
||||
for (request_sender_meta, request) in requests {
|
||||
let info_hash_allowed = torrent_maps
|
||||
.access_list
|
||||
.allows(config.access_list.mode, &request.info_hash.0);
|
||||
|
||||
if !info_hash_allowed {
|
||||
// let response = OutMessage::ErrorResponse();
|
||||
|
||||
// out_message_sender.send(request_sender_meta, response);
|
||||
// wake_socket_workers[request_sender_meta.worker_index] = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
let torrent_data: &mut TorrentData = if request_sender_meta.converted_peer_ip.is_ipv4() {
|
||||
torrent_maps.ipv4.entry(request.info_hash).or_default()
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue