]> git.kaiwu.me - nginx.git/commitdiff
QUIC: fixed PTO expiration condition.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 1 Aug 2023 07:21:59 +0000 (11:21 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 1 Aug 2023 07:21:59 +0000 (11:21 +0400)
Previously, PTO handler analyzed the first packet in the sent queue for the
timeout expiration.  However, the last sent packet should be analyzed instead.
An example is timeout calculation in ngx_quic_set_lost_timer().

src/event/quic/ngx_event_quic_ack.c

index e6210653ac8610a9557d994ef303377f9df32c84..04fc6676018d57c2f446f1a9bd9f431b8c0c3b82 100644 (file)
@@ -840,7 +840,7 @@ ngx_quic_pto_handler(ngx_event_t *ev)
             continue;
         }
 
-        q = ngx_queue_head(&ctx->sent);
+        q = ngx_queue_last(&ctx->sent);
         f = ngx_queue_data(q, ngx_quic_frame_t, queue);
 
         if (f->pnum <= ctx->largest_ack