Skip to content

Commit

Permalink
Rename internal field, add changelog item
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Nov 10, 2023
1 parent 310e2a0 commit 5a50ef8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions transports/quic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.10.1 - unreleased

- Allow disabling MTU discovering.
See [PR 4823].

[PR 4823]: https://github.com/libp2p/rust-libp2p/pull/4823

## 0.10.0

- Improve hole-punch timing.
Expand Down
10 changes: 5 additions & 5 deletions transports/quic/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct Config {
keypair: libp2p_identity::Keypair,

/// Parameters governing MTU discovery. See [`MtuDiscoveryConfig`] for details.
path_mtu_discovery_config: Option<MtuDiscoveryConfig>,
mtu_discovery_config: Option<MtuDiscoveryConfig>,
}

impl Config {
Expand All @@ -86,13 +86,13 @@ impl Config {
// Ensure that one stream is not consuming the whole connection.
max_stream_data: 10_000_000,
keypair: keypair.clone(),
path_mtu_discovery_config: Some(Default::default()),
mtu_discovery_config: Some(Default::default()),
}
}

/// Disable MTU path discovery (it is enabled by default).
pub fn disable_path_mtu_discovery(mut self) -> Self {
self.path_mtu_discovery_config = None;
self.mtu_discovery_config = None;
self
}
}
Expand All @@ -118,7 +118,7 @@ impl From<Config> for QuinnConfig {
support_draft_29,
handshake_timeout: _,
keypair,
path_mtu_discovery_config,
mtu_discovery_config,
} = config;
let mut transport = quinn::TransportConfig::default();
// Disable uni-directional streams.
Expand All @@ -131,7 +131,7 @@ impl From<Config> for QuinnConfig {
transport.allow_spin(false);
transport.stream_receive_window(max_stream_data.into());
transport.receive_window(max_connection_data.into());
transport.mtu_discovery_config(path_mtu_discovery_config);
transport.mtu_discovery_config(mtu_discovery_config);
let transport = Arc::new(transport);

let mut server_config = quinn::ServerConfig::with_crypto(server_tls_config);
Expand Down

0 comments on commit 5a50ef8

Please sign in to comment.