mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
aquatic_udp: use cleaner request filtering by access list
This commit is contained in:
parent
8c3db1b9b9
commit
429ffc8301
1 changed files with 10 additions and 15 deletions
|
|
@ -146,22 +146,17 @@ fn read_requests(
|
||||||
}
|
}
|
||||||
|
|
||||||
match request {
|
match request {
|
||||||
Ok(request) => {
|
Ok(Request::Announce(AnnounceRequest { info_hash, transaction_id, ..})) if !state.access_list.allows(access_list_mode, &info_hash.0) => {
|
||||||
if let Request::Announce(AnnounceRequest { info_hash, transaction_id, ..}) = request {
|
let response = Response::Error(ErrorResponse {
|
||||||
if state.access_list.allows(access_list_mode, &info_hash.0) {
|
transaction_id,
|
||||||
requests.push((request, src));
|
message: "Info hash not allowed".into()
|
||||||
} else {
|
});
|
||||||
let response = Response::Error(ErrorResponse {
|
|
||||||
transaction_id,
|
|
||||||
message: "Info hash not allowed".into()
|
|
||||||
});
|
|
||||||
|
|
||||||
local_responses.push((response, src))
|
local_responses.push((response, src))
|
||||||
}
|
},
|
||||||
} else {
|
Ok(request) => {
|
||||||
requests.push((request, src));
|
requests.push((request, src));
|
||||||
}
|
},
|
||||||
}
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
::log::debug!("request_from_bytes error: {:?}", err);
|
::log::debug!("request_from_bytes error: {:?}", err);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue