@@ -10,7 +10,7 @@ pub use crate::recovery::FAST_PTO_SCALE;
10
10
use crate :: {
11
11
connection:: { ConnectionIdManager , Role , LOCAL_ACTIVE_CID_LIMIT } ,
12
12
recv_stream:: RECV_BUFFER_SIZE ,
13
- rtt:: GRANULARITY ,
13
+ rtt:: { DEFAULT_INITIAL_RTT , GRANULARITY } ,
14
14
stream_id:: StreamType ,
15
15
tparams:: { self , PreferredAddress , TransportParameter , TransportParametersHandler } ,
16
16
tracking:: DEFAULT_ACK_DELAY ,
@@ -70,6 +70,7 @@ pub struct ConnectionParameters {
70
70
/// acknowledgments every round trip, set the value to `5 * ACK_RATIO_SCALE`.
71
71
/// Values less than `ACK_RATIO_SCALE` are clamped to `ACK_RATIO_SCALE`.
72
72
ack_ratio : u8 ,
73
+ initial_rtt : Duration ,
73
74
/// The duration of the idle timeout for the connection.
74
75
idle_timeout : Duration ,
75
76
preferred_address : PreferredAddressConfig ,
@@ -96,6 +97,7 @@ impl Default for ConnectionParameters {
96
97
max_streams_uni : LOCAL_STREAM_LIMIT_UNI ,
97
98
ack_ratio : DEFAULT_ACK_RATIO ,
98
99
idle_timeout : DEFAULT_IDLE_TIMEOUT ,
100
+ initial_rtt : DEFAULT_INITIAL_RTT ,
99
101
preferred_address : PreferredAddressConfig :: Default ,
100
102
datagram_size : 0 ,
101
103
outgoing_datagram_queue : MAX_QUEUED_DATAGRAMS_DEFAULT ,
@@ -268,6 +270,17 @@ impl ConnectionParameters {
268
270
self . datagram_size
269
271
}
270
272
273
+ #[ must_use]
274
+ pub const fn get_initial_rtt ( & self ) -> Duration {
275
+ self . initial_rtt
276
+ }
277
+
278
+ #[ must_use]
279
+ pub const fn initial_rtt ( mut self , init_rtt : Duration ) -> Self {
280
+ self . initial_rtt = init_rtt;
281
+ self
282
+ }
283
+
271
284
#[ must_use]
272
285
pub const fn datagram_size ( mut self , v : u64 ) -> Self {
273
286
self . datagram_size = v;
0 commit comments