comparison src/event/quic/ngx_event_quic.c @ 9092:9553eea74f2a quic

QUIC: optimized immediate close. Previously, before sending CONNECTION_CLOSE to client, all pending frames were sent. This is redundant and could prevent CONNECTION_CLOSE from being sent due to congestion control. Now pending frames are freed and CONNECTION_CLOSE is sent without congestion control, as advised by RFC 9002: Packets containing frames besides ACK or CONNECTION_CLOSE frames count toward congestion control limits and are considered to be in flight.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 02 May 2023 17:54:53 +0400
parents be39ffdf9208
children d59277dd3d8c
comparison
equal deleted inserted replaced
9091:8f2f40d3fd18 9092:9553eea74f2a
480 480
481 if (!qc->closing) { 481 if (!qc->closing) {
482 482
483 /* drop packets from retransmit queues, no ack is expected */ 483 /* drop packets from retransmit queues, no ack is expected */
484 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { 484 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) {
485 ngx_quic_free_frames(c, &qc->send_ctx[i].frames);
485 ngx_quic_free_frames(c, &qc->send_ctx[i].sent); 486 ngx_quic_free_frames(c, &qc->send_ctx[i].sent);
486 } 487 }
487 488
488 if (rc == NGX_DONE) { 489 if (rc == NGX_DONE) {
489 490