[nginx] QUIC: fixed rttvar on subsequent RTT samples (ticket #2505).

Sergey Kandaurov pluknet at nginx.com
Tue Jun 13 07:11:29 UTC 2023


details:   https://hg.nginx.org/nginx/rev/a32905d6fc10
branches:  
changeset: 9122:a32905d6fc10
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Mon Jun 12 23:38:56 2023 +0400
description:
QUIC: fixed rttvar on subsequent RTT samples (ticket #2505).

Previously, computing rttvar used an updated smoothed_rtt value as per
RFC 9002, section 5.3, which appears to be specified in a wrong order.
A technical errata ID 7539 is reported.

diffstat:

 src/event/quic/ngx_event_quic_ack.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 262c01782566 -r a32905d6fc10 src/event/quic/ngx_event_quic_ack.c
--- a/src/event/quic/ngx_event_quic_ack.c	Thu Jun 08 16:56:46 2023 +0400
+++ b/src/event/quic/ngx_event_quic_ack.c	Mon Jun 12 23:38:56 2023 +0400
@@ -207,9 +207,9 @@ ngx_quic_rtt_sample(ngx_connection_t *c,
             adjusted_rtt -= ack_delay;
         }
 
-        qc->avg_rtt += (adjusted_rtt >> 3) - (qc->avg_rtt >> 3);
         rttvar_sample = ngx_abs((ngx_msec_int_t) (qc->avg_rtt - adjusted_rtt));
         qc->rttvar += (rttvar_sample >> 2) - (qc->rttvar >> 2);
+        qc->avg_rtt += (adjusted_rtt >> 3) - (qc->avg_rtt >> 3);
     }
 
     ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,


More information about the nginx-devel mailing list