diff options
author | Vladimir Homutov <vl@nginx.com> | 2020-10-28 14:22:51 +0300 |
---|---|---|
committer | Vladimir Homutov <vl@nginx.com> | 2020-10-28 14:22:51 +0300 |
commit | 21a5955f75688647b794e655635c23ecf1b4e290 (patch) | |
tree | 3d31bd878be3dc973bbe365fbc0729530212d206 /src | |
parent | 54187d2d7a3cd2a34105a9ccaee732b76e6c3cf5 (diff) | |
download | nginx-21a5955f75688647b794e655635c23ecf1b4e290.tar.gz nginx-21a5955f75688647b794e655635c23ecf1b4e290.zip |
QUIC: avoided retransmission of stale ack frames.
Acknowledgments are regenerated using the most recent data available.
Diffstat (limited to 'src')
-rw-r--r-- | src/event/ngx_event_quic.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index 9cdc41e9c..9b83ed083 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -4843,6 +4843,8 @@ ngx_quic_resend_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx) ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "quic resend packet pnum:%uL", start->pnum); + ngx_quic_congestion_lost(c, start); + do { f = ngx_queue_data(q, ngx_quic_frame_t, queue); @@ -4853,11 +4855,20 @@ ngx_quic_resend_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx) q = ngx_queue_next(q); ngx_queue_remove(&f->queue); - ngx_queue_insert_tail(&ctx->frames, &f->queue); - } while (q != ngx_queue_sentinel(&ctx->sent)); + switch (f->type) { + case NGX_QUIC_FT_ACK: + case NGX_QUIC_FT_ACK_ECN: + /* force generation of most recent acknowledgment */ + ctx->send_ack = NGX_QUIC_MAX_ACK_GAP; + ngx_quic_free_frame(c, f); + break; - ngx_quic_congestion_lost(c, start); + default: + ngx_queue_insert_tail(&ctx->frames, &f->queue); + } + + } while (q != ngx_queue_sentinel(&ctx->sent)); if (qc->closing) { return; |