@@ -48,7 +48,7 @@ use crate::{
48
48
quic_datagrams:: { DatagramTracking , QuicDatagrams } ,
49
49
recovery:: { LossRecovery , RecoveryToken , SendProfile , SentPacket } ,
50
50
recv_stream:: RecvStreamStats ,
51
- rtt:: { RttEstimate , GRANULARITY , INITIAL_RTT } ,
51
+ rtt:: { RttEstimate , GRANULARITY } ,
52
52
send_stream:: SendStream ,
53
53
stats:: { Stats , StatsCell } ,
54
54
stream_id:: StreamType ,
@@ -604,7 +604,7 @@ impl Connection {
604
604
// When we have no actual RTT sample, do not encode a guestimated RTT larger
605
605
// than the default initial RTT. (The guess can be very large under lossy
606
606
// conditions.)
607
- if rtt < INITIAL_RTT {
607
+ if rtt < self . conn_params . get_initial_rtt ( ) {
608
608
rtt
609
609
} else {
610
610
Duration :: from_millis ( 0 )
@@ -638,7 +638,7 @@ impl Connection {
638
638
/// only use it where a more precise value is not important.
639
639
fn pto ( & self ) -> Duration {
640
640
self . paths . primary ( ) . map_or_else (
641
- || RttEstimate :: default ( ) . pto ( self . confirmed ( ) ) ,
641
+ || RttEstimate :: new ( self . conn_params . get_initial_rtt ( ) ) . pto ( self . confirmed ( ) ) ,
642
642
|p| p. borrow ( ) . rtt ( ) . pto ( self . confirmed ( ) ) ,
643
643
)
644
644
}
0 commit comments