diff --git a/aquatic_udp/src/lib/network.rs b/aquatic_udp/src/lib/network.rs index 306f167..6de42cb 100644 --- a/aquatic_udp/src/lib/network.rs +++ b/aquatic_udp/src/lib/network.rs @@ -146,22 +146,17 @@ fn read_requests( } match request { - Ok(request) => { - if let Request::Announce(AnnounceRequest { info_hash, transaction_id, ..}) = request { - if state.access_list.allows(access_list_mode, &info_hash.0) { - requests.push((request, src)); - } else { - let response = Response::Error(ErrorResponse { - transaction_id, - message: "Info hash not allowed".into() - }); + Ok(Request::Announce(AnnounceRequest { info_hash, transaction_id, ..})) if !state.access_list.allows(access_list_mode, &info_hash.0) => { + let response = Response::Error(ErrorResponse { + transaction_id, + message: "Info hash not allowed".into() + }); - local_responses.push((response, src)) - } - } else { - requests.push((request, src)); - } - } + local_responses.push((response, src)) + }, + Ok(request) => { + requests.push((request, src)); + }, Err(err) => { ::log::debug!("request_from_bytes error: {:?}", err);