]> git.kaiwu.me - nginx.git/commitdiff
QUIC: do not arm loss detection timer for succeeding packets.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 19 Aug 2020 10:24:47 +0000 (13:24 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 19 Aug 2020 10:24:47 +0000 (13:24 +0300)
src/event/ngx_event_quic.c

index f0f07bf38f55821a74d09006ead252fd54f7ce55..0781bcfb0aa33ac1c57386edcff89a69523f8bf9 100644 (file)
@@ -3781,11 +3781,19 @@ ngx_quic_detect_lost(ngx_connection_t *c)
 
         ctx = &qc->send_ctx[i];
 
+        if (ctx->largest_ack == (uint64_t) -1) {
+            continue;
+        }
+
         while (!ngx_queue_empty(&ctx->sent)) {
 
             q = ngx_queue_head(&ctx->sent);
             start = ngx_queue_data(q, ngx_quic_frame_t, queue);
 
+            if (start->pnum > ctx->largest_ack) {
+                break;
+            }
+
             wait = start->last + thr - now;
 
             ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,
@@ -3798,10 +3806,7 @@ ngx_quic_detect_lost(ngx_connection_t *c)
                     min_wait = wait;
                 }
 
-                if ((start->pnum > ctx->largest_ack)
-                     || ctx->largest_ack == (uint64_t) -1
-                     || ((ctx->largest_ack - start->pnum) < NGX_QUIC_PKT_THR))
-                {
+                if (ctx->largest_ack - start->pnum < NGX_QUIC_PKT_THR) {
                     break;
                 }
             }