From 9145ee7bc567a22b6a72ad37f553a0e24b818922 Mon Sep 17 00:00:00 2001 From: godmodegalactus Date: Wed, 29 May 2024 17:51:11 +0200 Subject: [PATCH] increasing max ttl --- client/src/non_blocking/client.rs | 2 +- common/src/defaults.rs | 4 ++-- server/src/quiche_server_loop.rs | 33 +++++++++++-------------------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/client/src/non_blocking/client.rs b/client/src/non_blocking/client.rs index e6f5e42..758b1f1 100644 --- a/client/src/non_blocking/client.rs +++ b/client/src/non_blocking/client.rs @@ -127,7 +127,7 @@ impl Client { let _ = sender.send(message); } Err(e) => { - log::error!("Error getting message {}", e); + log::trace!("Error getting message {}", e); } } }); diff --git a/common/src/defaults.rs b/common/src/defaults.rs index 11f35e6..efea540 100644 --- a/common/src/defaults.rs +++ b/common/src/defaults.rs @@ -3,7 +3,7 @@ pub const MAX_ALLOWED_PARTIAL_RESPONSES: usize = 32 * 1024; pub const DEFAULT_MAX_RECIEVE_WINDOW_SIZE: u64 = 1024 * 1024; // 1 MBs pub const DEFAULT_CONNECTION_TIMEOUT: u64 = 10; pub const DEFAULT_MAX_NB_CONNECTIONS: u64 = 10; -pub const DEFAULT_MAX_ACK_DELAY: u64 = 250; +pub const DEFAULT_MAX_ACK_DELAY: u64 = 400; pub const DEFAULT_ACK_EXPONENT: u64 = 3; pub const ALPN_GEYSER_PROTOCOL_ID: &[u8] = b"geyser"; -pub const MAX_DATAGRAM_SIZE: usize = 1350; // MAX: 65527 +pub const MAX_DATAGRAM_SIZE: usize = 2000; // MAX: 65527 diff --git a/server/src/quiche_server_loop.rs b/server/src/quiche_server_loop.rs index 9e62c20..7e9e92b 100644 --- a/server/src/quiche_server_loop.rs +++ b/server/src/quiche_server_loop.rs @@ -299,6 +299,7 @@ pub fn server_loop( } } +#[allow(clippy::too_many_arguments)] fn create_client_task( connection: quiche::Connection, receiver: mpsc::Receiver<(quiche::RecvInfo, Vec)>, @@ -384,16 +385,8 @@ fn create_client_task( ); } } - if send_message( - &mut connection, - &mut partial_responses, - stream_id, - &message, - ).is_err() { - true - } else { - false - } + send_message(&mut connection, &mut partial_responses, stream_id, &message) + .is_err() } Err(e) => { match e { @@ -406,20 +399,16 @@ fn create_client_task( } }; - if close && !closed { - if stop_laggy_client && !closed { - if let Err(e) = connection.close(true, 1, b"laggy client") { - if e != quiche::Error::Done { - log::error!("error closing client : {}", e); - } - } else { - log::info!( - "Stopping laggy client : {}", - connection.trace_id(), - ); + if close && !closed && stop_laggy_client { + if let Err(e) = connection.close(true, 1, b"laggy client") { + if e != quiche::Error::Done { + log::error!("error closing client : {}", e); } - closed = true; + } else { + log::info!("Stopping laggy client : {}", connection.trace_id(),); } + closed = true; + break; } }