diff options
| author | Roman Arutyunyan <arut@nginx.com> | 2020-04-24 17:20:37 +0300 |
|---|---|---|
| committer | Roman Arutyunyan <arut@nginx.com> | 2020-04-24 17:20:37 +0300 |
| commit | 60c8a601d08523bba989f55b68315780d435eba5 (patch) | |
| tree | 142d98f755be7580daa93f11a0b0f5827c64154e | |
| parent | 9c375910161cdcac5bb616f6afb8de030849f2ca (diff) | |
| download | nginx-60c8a601d08523bba989f55b68315780d435eba5.tar.gz nginx-60c8a601d08523bba989f55b68315780d435eba5.tar.bz2 | |
Fixed packet retransmission.
Previously frames in ctx->sent queue could be lost.
| -rw-r--r-- | src/event/ngx_event_quic.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index ef8e237d2..16b3a91fc 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -2586,11 +2586,18 @@ ngx_quic_retransmit(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx, } q = ngx_queue_head(&ctx->sent); - start = ngx_queue_data(q, ngx_quic_frame_t, queue); - pn = start->pnum; - f = start; do { + start = ngx_queue_data(q, ngx_quic_frame_t, queue); + + wait = start->last + qc->tp.max_ack_delay - now; + + if ((ngx_msec_int_t) wait > 0) { + break; + } + + pn = start->pnum; + ngx_queue_init(&range); /* send frames with same packet number to the wire */ @@ -2614,12 +2621,6 @@ ngx_quic_retransmit(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx, } while (q != ngx_queue_sentinel(&ctx->sent)); - wait = start->last + qc->tp.max_ack_delay - now; - - if ((ngx_msec_int_t) wait > 0) { - break; - } - /* NGX_DONE is impossible here, such frames don't get into this queue */ if (ngx_quic_send_frames(c, &range) != NGX_OK) { return NGX_ERROR; |
