mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
udp: rename MAX_PACKET_SIZE to BUFFER_SIZE
This commit is contained in:
parent
07630d2e0c
commit
d6e5155acf
2 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ use aquatic_udp_protocol::*;
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
|
|
||||||
pub const MAX_PACKET_SIZE: usize = 8192;
|
pub const BUFFER_SIZE: usize = 8192;
|
||||||
|
|
||||||
/// HMAC (BLAKE3) based ConnectionID creator and validator
|
/// HMAC (BLAKE3) based ConnectionID creator and validator
|
||||||
///
|
///
|
||||||
|
|
@ -299,7 +299,7 @@ mod tests {
|
||||||
// Assumes that announce response with maximum amount of ipv6 peers will
|
// Assumes that announce response with maximum amount of ipv6 peers will
|
||||||
// be the longest
|
// be the longest
|
||||||
#[test]
|
#[test]
|
||||||
fn test_max_package_size() {
|
fn test_buffer_size() {
|
||||||
use aquatic_udp_protocol::*;
|
use aquatic_udp_protocol::*;
|
||||||
|
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
|
|
@ -325,7 +325,7 @@ mod tests {
|
||||||
|
|
||||||
println!("Buffer len: {}", buf.len());
|
println!("Buffer len: {}", buf.len());
|
||||||
|
|
||||||
assert!(buf.len() <= MAX_PACKET_SIZE);
|
assert!(buf.len() <= BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[quickcheck]
|
#[quickcheck]
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ pub fn run_socket_worker(
|
||||||
response_receiver: Receiver<(ConnectedResponse, CanonicalSocketAddr)>,
|
response_receiver: Receiver<(ConnectedResponse, CanonicalSocketAddr)>,
|
||||||
priv_dropper: PrivilegeDropper,
|
priv_dropper: PrivilegeDropper,
|
||||||
) {
|
) {
|
||||||
let mut buffer = [0u8; MAX_PACKET_SIZE];
|
let mut buffer = [0u8; BUFFER_SIZE];
|
||||||
|
|
||||||
let mut socket =
|
let mut socket =
|
||||||
UdpSocket::from_std(create_socket(&config, priv_dropper).expect("create socket"));
|
UdpSocket::from_std(create_socket(&config, priv_dropper).expect("create socket"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue