Skip to content

Commit

Permalink
Adjust mtu
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-koshy committed Mar 21, 2024
1 parent 7d11567 commit c930f1b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/anemo/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
PeerId, Result,
};
use pkcs8::EncodePrivateKey;
use quinn::{congestion, VarInt};
use quinn::{congestion, MtuDiscoveryConfig, VarInt};
use rcgen::{CertificateParams, KeyPair, SignatureAlgorithm};
use serde::{Deserialize, Serialize};
use std::{sync::Arc, time::Duration};
Expand Down Expand Up @@ -347,7 +347,15 @@ impl QuicConfig {
cc_config.initial_window(4 << 20);
// todo: find replacement, minimum window no longer supported
// cc_config.minimum_window(1 << 20);
config.congestion_controller_factory(Arc::new(cc_config));

let mut mtu_discovery = MtuDiscoveryConfig::default();
mtu_discovery.upper_bound(1500);
config.mtu_discovery_config(Some(mtu_discovery));

config
.congestion_controller_factory(Arc::new(cc_config))
.initial_mtu(1500)
.min_mtu(1500);

config
}
Expand Down

0 comments on commit c930f1b

Please sign in to comment.