aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2020-10-27 00:14:24 +0300
committerVladimir Homutov <vl@nginx.com>2020-10-27 00:14:24 +0300
commit68f7e9540a0852bc69453058ae7588c77a3a1494 (patch)
treeafc1c940fc2636eb172f706137b88699233fdc57 /src
parenta1473ce8b08cba7959daee8860677f70d4e36c8a (diff)
downloadnginx-68f7e9540a0852bc69453058ae7588c77a3a1494.tar.gz
nginx-68f7e9540a0852bc69453058ae7588c77a3a1494.zip
QUIC: cleanup send context properly.
The patch resets ctx->frames queue, which may contain frames. It was possible that congestion or amplification limits prevented all frames to be sent. Retransmitted frames could be accounted twice as inflight: first time in ngx_quic_congestion_lost() called from ngx_quic_resend_frames(), and later from ngx_quic_discard_ctx().
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_quic.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c
index dcdea293c..5cffeaebc 100644
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -2254,6 +2254,15 @@ ngx_quic_discard_ctx(ngx_connection_t *c, enum ssl_encryption_level_t level)
ngx_quic_free_frame(c, f);
}
+ while (!ngx_queue_empty(&ctx->frames)) {
+ q = ngx_queue_head(&ctx->frames);
+ ngx_queue_remove(q);
+
+ f = ngx_queue_data(q, ngx_quic_frame_t, queue);
+ ngx_quic_congestion_ack(c, f);
+ ngx_quic_free_frame(c, f);
+ }
+
ctx->send_ack = 0;
}
@@ -5677,6 +5686,7 @@ ngx_quic_congestion_lost(ngx_connection_t *c, ngx_quic_frame_t *f)
cg = &qc->congestion;
cg->in_flight -= f->plen;
+ f->plen = 0;
timer = f->last - cg->recovery_start;