]> git.kaiwu.me - nginx.git/commitdiff
QUIC: always add ACK frame to the queue head.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 10 Aug 2023 16:11:29 +0000 (20:11 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 10 Aug 2023 16:11:29 +0000 (20:11 +0400)
Previously it was added to the tail as all other frames.  However, if the
amount of queued data is large, it could delay the delivery of ACK, which
could trigger frames retransmissions and slow down the connection.

src/event/quic/ngx_event_quic_output.c

index 38006a9a5057e250efd3fe99012c088914796910..88b7df6ab1056014a167f3643343a5bd43eb0a43 100644 (file)
@@ -1174,8 +1174,9 @@ ngx_quic_send_ack(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx)
     frame->u.ack.delay = ack_delay;
     frame->u.ack.range_count = ctx->nranges;
     frame->u.ack.first_range = ctx->first_range;
+    frame->len = ngx_quic_create_frame(NULL, frame);
 
-    ngx_quic_queue_frame(qc, frame);
+    ngx_queue_insert_head(&ctx->frames, &frame->queue);
 
     return NGX_OK;
 }