Log initial RTT update
@@ -8692,9 +8692,7 @@ void ngtcp2_conn_update_rtt(ngtcp2_conn *conn, ngtcp2_duration rtt,
rcs->min_rtt = rtt;
rcs->smoothed_rtt = rtt;
rcs->rttvar = rtt / 2;
- return;
- }
-
+ } else {
rcs->min_rtt = ngtcp2_min(rcs->min_rtt, rtt);
if (conn->flags & NGTCP2_CONN_FLAG_HANDSHAKE_COMPLETED) {
ack_delay =
@@ -8706,11 +8704,12 @@ void ngtcp2_conn_update_rtt(ngtcp2_conn *conn, ngtcp2_duration rtt,
rtt -= ack_delay;
}
- rcs->rttvar =
- (rcs->rttvar * 3 + (rcs->smoothed_rtt < rtt ? rtt - rcs->smoothed_rtt
+ rcs->rttvar = (rcs->rttvar * 3 + (rcs->smoothed_rtt < rtt
+ ? rtt - rcs->smoothed_rtt
: rcs->smoothed_rtt - rtt)) /
4;
rcs->smoothed_rtt = (rcs->smoothed_rtt * 7 + rtt) / 8;
+ }
ngtcp2_log_info(&conn->log, NGTCP2_LOG_EVENT_RCV,
"latest_rtt=%" PRIu64 " min_rtt=%" PRIu64
