From 8da806f793a6fc17af0e9a01b85788410982202b Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Tue, 23 Apr 2024 10:55:20 +0900 Subject: [PATCH] when promoting the path, reset RTT estimate --- lib/quicly.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/quicly.c b/lib/quicly.c index 40eeb187..36a25dba 100644 --- a/lib/quicly.c +++ b/lib/quicly.c @@ -1887,6 +1887,13 @@ static int promote_path(quicly_conn_t *conn, size_t path_index) conn->egress.cc.type->cc_init, &conn->egress.cc, quicly_cc_calc_initial_cwnd(conn->super.ctx->initcwnd_packets, conn->egress.max_udp_payload_size), conn->stash.now); + /* reset RTT estimate, adopting SRTT of the original path as initial RTT (TODO calculate RTT based on path challenge RT) */ + quicly_rtt_init(&conn->egress.loss.rtt, &conn->super.ctx->loss, + conn->egress.loss.rtt.smoothed < conn->super.ctx->loss.default_initial_rtt + ? conn->egress.loss.rtt.smoothed + : conn->super.ctx->loss.default_initial_rtt); + + /* remember PN when the path was promoted */ conn->egress.pn_path_start = conn->egress.packet_number; /* update path mapping */