Skip to content

Commit

Permalink
Raise default idle timeout to 30 seconds
Browse files Browse the repository at this point in the history
Recommended in RFC9308 § 3.2 for use on the public internet when a NAT
may be on the path.
  • Loading branch information
Ralith committed Jul 25, 2024
1 parent 2677bce commit 21d9a92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions quinn-proto/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl TransportConfig {
/// Maximum duration of inactivity to accept before timing out the connection.
///
/// The true idle timeout is the minimum of this and the peer's own max idle timeout. `None`
/// represents an infinite timeout.
/// represents an infinite timeout. Defaults to 30 seconds.
///
/// **WARNING**: If a peer or its network path malfunctions or acts maliciously, an infinite
/// idle timeout can result in permanently hung futures!
Expand Down Expand Up @@ -334,7 +334,8 @@ impl Default for TransportConfig {
Self {
max_concurrent_bidi_streams: 100u32.into(),
max_concurrent_uni_streams: 100u32.into(),
max_idle_timeout: Some(VarInt(10_000)),
// 30 second default recommended by RFC 9308 § 3.2
max_idle_timeout: Some(VarInt(30_000)),
stream_receive_window: STREAM_RWND.into(),
receive_window: VarInt::MAX,
send_window: (8 * STREAM_RWND).into(),
Expand Down

0 comments on commit 21d9a92

Please sign in to comment.