mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: improve variable naming in read_requests
This commit is contained in:
parent
9d3420ba1c
commit
fb9d703007
1 changed files with 4 additions and 4 deletions
|
|
@ -31,7 +31,7 @@ pub fn read_requests(
|
|||
|
||||
loop {
|
||||
match socket.recv_from(&mut buffer[..]) {
|
||||
Ok((amt, src)) => {
|
||||
Ok((bytes_read, src)) => {
|
||||
if src.port() == 0 {
|
||||
::log::info!("Ignored request from {} because source port is zero", src);
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ pub fn read_requests(
|
|||
}
|
||||
|
||||
let res_request =
|
||||
Request::from_bytes(&buffer[..amt], config.protocol.max_scrape_torrents);
|
||||
Request::from_bytes(&buffer[..bytes_read], config.protocol.max_scrape_torrents);
|
||||
|
||||
let src = CanonicalSocketAddr::new(src);
|
||||
|
||||
|
|
@ -48,12 +48,12 @@ pub fn read_requests(
|
|||
if res_request.is_ok() {
|
||||
requests_received_ipv4 += 1;
|
||||
}
|
||||
bytes_received_ipv4 += amt;
|
||||
bytes_received_ipv4 += bytes_read;
|
||||
} else {
|
||||
if res_request.is_ok() {
|
||||
requests_received_ipv6 += 1;
|
||||
}
|
||||
bytes_received_ipv6 += amt;
|
||||
bytes_received_ipv6 += bytes_read;
|
||||
}
|
||||
|
||||
handle_request(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue