diff --git a/aquatic_udp/src/common.rs b/aquatic_udp/src/common.rs index 2b42542..db7c47c 100644 --- a/aquatic_udp/src/common.rs +++ b/aquatic_udp/src/common.rs @@ -15,7 +15,7 @@ use aquatic_udp_protocol::*; use crate::config::Config; -pub const MAX_PACKET_SIZE: usize = 8192; +pub const BUFFER_SIZE: usize = 8192; /// HMAC (BLAKE3) based ConnectionID creator and validator /// @@ -299,7 +299,7 @@ mod tests { // Assumes that announce response with maximum amount of ipv6 peers will // be the longest #[test] - fn test_max_package_size() { + fn test_buffer_size() { use aquatic_udp_protocol::*; let config = Config::default(); @@ -325,7 +325,7 @@ mod tests { println!("Buffer len: {}", buf.len()); - assert!(buf.len() <= MAX_PACKET_SIZE); + assert!(buf.len() <= BUFFER_SIZE); } #[quickcheck] diff --git a/aquatic_udp/src/workers/socket.rs b/aquatic_udp/src/workers/socket.rs index d3eda3c..b70107c 100644 --- a/aquatic_udp/src/workers/socket.rs +++ b/aquatic_udp/src/workers/socket.rs @@ -140,7 +140,7 @@ pub fn run_socket_worker( response_receiver: Receiver<(ConnectedResponse, CanonicalSocketAddr)>, priv_dropper: PrivilegeDropper, ) { - let mut buffer = [0u8; MAX_PACKET_SIZE]; + let mut buffer = [0u8; BUFFER_SIZE]; let mut socket = UdpSocket::from_std(create_socket(&config, priv_dropper).expect("create socket"));