refactor(quic, tcp): comment out unused congestion control code

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2025-09-26 18:06:12 +08:00
parent e6a0b9372d
commit ae6503acfc
No known key found for this signature in database
GPG Key ID: 647A0EE86907F1AF
2 changed files with 12 additions and 10 deletions

View File

@ -25,7 +25,8 @@ use dragonfly_client_util::{
id_generator::IDGenerator, shutdown, tls::generate_simple_self_signed_certs,
};
use leaky_bucket::RateLimiter;
use quinn::{congestion::BbrConfig, AckFrequencyConfig, Endpoint, ServerConfig, TransportConfig};
// use quinn::{congestion::BbrConfig, AckFrequencyConfig, Endpoint, ServerConfig, TransportConfig};
use quinn::{AckFrequencyConfig, Endpoint, ServerConfig, TransportConfig};
use std::net::SocketAddr;
use std::sync::Arc;
use tokio::io::{copy, AsyncRead};
@ -89,7 +90,7 @@ impl QUICServer {
})?;
let mut transport = TransportConfig::default();
transport.congestion_controller_factory(Arc::new(BbrConfig::default()));
// transport.congestion_controller_factory(Arc::new(BbrConfig::default()));
transport.keep_alive_interval(Some(super::DEFAULT_KEEPALIVE_INTERVAL));
transport.max_idle_timeout(Some(super::DEFAULT_MAX_IDLE_TIMEOUT.try_into().unwrap()));
transport.ack_frequency_config(Some(AckFrequencyConfig::default()));

View File

@ -97,14 +97,15 @@ impl TCPServer {
socket.set_tcp_keepalive(
&TcpKeepalive::new().with_interval(super::DEFAULT_KEEPALIVE_INTERVAL),
)?;
#[cfg(target_os = "linux")]
{
use tracing::warn;
if let Err(err) = socket.set_tcp_congestion("bbr".as_bytes()) {
warn!("failed to set tcp congestion: {}", err);
}
info!("set tcp congestion to bbr");
}
// #[cfg(target_os = "linux")]
// {
// use tracing::warn;
// if let Err(err) = socket.set_tcp_congestion("bbr".as_bytes()) {
// warn!("failed to set tcp congestion: {}", err);
// } else {
// info!("set tcp congestion to bbr");
// }
// }
socket.bind(&self.addr.into())?;
socket.listen(1024)?;