Mirror quic config on outgoing and inbound connections

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2026-03-26 17:35:12 +01:00
parent f7c105a3f2
commit 6a4f51555b
2 changed files with 9 additions and 3 deletions
+2
View File
@@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
working. This should improve route acquisition after spurious network interrupts.
- Route request cache now properly cleans and maintains entries to avoid sending
duplicates to peers.
- Make sure the configuration for Quic connections is the same for outbound and
inbound connections.
## [0.7.4] - 2026-03-23
+7 -3
View File
@@ -669,7 +669,6 @@ where
}
};
let mut config = quinn::ClientConfig::new(Arc::new(qcc));
// Todo: tweak transport config
let mut transport_config = TransportConfig::default();
transport_config.max_concurrent_uni_streams(0_u8.into());
// Larger than needed for now, just in case
@@ -679,10 +678,15 @@ where
transport_config.max_idle_timeout(Some(Duration::from_secs(60).try_into().unwrap()));
transport_config.mtu_discovery_config(Some(MtuDiscoveryConfig::default()));
transport_config.keep_alive_interval(Some(Duration::from_secs(20)));
// we don't use datagrams.
transport_config.datagram_receive_buffer_size(Some(16 << 20));
transport_config.datagram_send_buffer_size(16 << 20);
transport_config.initial_mtu(1500);
transport_config.enable_segmentation_offload(true);
transport_config.send_window((8 * (10u32 << 20)).into());
transport_config.stream_receive_window((10u32 << 20).into());
let mut congestion_controller = congestion::CubicConfig::default();
congestion_controller.initial_window(1 << 22); // 4MiB
transport_config.congestion_controller_factory(Arc::new(congestion_controller));
config.transport_config(Arc::new(transport_config));
match quic_socket.connect_with(config, endpoint.address(), "dummy.mycelium") {
@@ -1296,7 +1300,7 @@ fn make_quic_endpoint(
transport_config.stream_receive_window((10u32 << 20).into());
let mut congestion_controller = congestion::CubicConfig::default();
congestion_controller.initial_window(1 << 22); // 4MiB
// TODO: further tweak this.
transport_config.congestion_controller_factory(Arc::new(congestion_controller));
let socket = std::net::UdpSocket::bind(("::", quic_listen_port))
.and_then(|socket| set_fw_mark(socket, firewall_mark))?;