# HG changeset patch # User Roman Arutyunyan # Date 1691683889 -14400 # Node ID d7dec29701615e996f2c3de3e1380dab18a34aea # Parent a90f79792b5d3056422af01f5ffef84d87502f7c QUIC: always add ACK frame to the queue head. 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. diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c --- a/src/event/quic/ngx_event_quic_output.c +++ b/src/event/quic/ngx_event_quic_output.c @@ -1174,8 +1174,9 @@ ngx_quic_send_ack(ngx_connection_t *c, n 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; }