@@ -17,7 +17,7 @@ use std::{
17
17
use clap:: Parser ;
18
18
use neqo_transport:: {
19
19
tparams:: PreferredAddress , CongestionControlAlgorithm , ConnectionParameters , StreamType ,
20
- Version ,
20
+ Version , INITIAL_RTT ,
21
21
} ;
22
22
23
23
pub mod client;
@@ -116,9 +116,9 @@ pub struct QuicParameters {
116
116
/// The idle timeout for connections, in seconds.
117
117
pub idle_timeout : u64 ,
118
118
119
- #[ arg( long = "init_rtt" , default_value = "100" ) ]
120
- /// The initial round-trip time.
121
- pub initial_rtt_ms : u64 ,
119
+ #[ arg( long = "init_rtt" ) ]
120
+ /// The initial round-trip time. Defaults to [``INITIAL_RTT``] if not specified.
121
+ pub initial_rtt_ms : Option < u64 > ,
122
122
123
123
#[ arg( long = "cc" , default_value = "newreno" ) ]
124
124
/// The congestion controller to use.
@@ -149,6 +149,7 @@ impl Default for QuicParameters {
149
149
max_streams_bidi : 16 ,
150
150
max_streams_uni : 16 ,
151
151
idle_timeout : 30 ,
152
+ initial_rtt_ms : None ,
152
153
congestion_control : CongestionControlAlgorithm :: NewReno ,
153
154
no_pacing : false ,
154
155
no_pmtud : false ,
@@ -217,7 +218,10 @@ impl QuicParameters {
217
218
. max_streams ( StreamType :: BiDi , self . max_streams_bidi )
218
219
. max_streams ( StreamType :: UniDi , self . max_streams_uni )
219
220
. idle_timeout ( Duration :: from_secs ( self . idle_timeout ) )
220
- . initial_rtt ( Duration :: from_millis ( self . initial_rtt_ms ) )
221
+ . initial_rtt (
222
+ self . initial_rtt_ms
223
+ . map_or ( INITIAL_RTT , Duration :: from_millis) ,
224
+ )
221
225
. cc_algorithm ( self . congestion_control )
222
226
. pacing ( !self . no_pacing )
223
227
. pmtud ( !self . no_pmtud ) ;
0 commit comments