Mercurial > hg > nginx
comparison src/event/ngx_event_quic.c @ 8512:6e1c88f82280 quic
QUIC: changed ctx->largest_ack initial value to type maximum.
In particular, this prevents declaring packet number 0 as lost if
there aren't yet any acknowledgements in this packet number space.
For example, only Initial packets were acknowledged in handshake.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 18 Aug 2020 23:33:40 +0300 |
parents | bce9e9643444 |
children | 38f1be6c603f |
comparison
equal
deleted
inserted
replaced
8511:830680e78b24 | 8512:6e1c88f82280 |
---|---|
688 | 688 |
689 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { | 689 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { |
690 ngx_queue_init(&qc->send_ctx[i].frames); | 690 ngx_queue_init(&qc->send_ctx[i].frames); |
691 ngx_queue_init(&qc->send_ctx[i].sent); | 691 ngx_queue_init(&qc->send_ctx[i].sent); |
692 qc->send_ctx[i].largest_pn = (uint64_t) -1; | 692 qc->send_ctx[i].largest_pn = (uint64_t) -1; |
693 qc->send_ctx[i].largest_ack = (uint64_t) -1; | |
693 } | 694 } |
694 | 695 |
695 for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) { | 696 for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) { |
696 ngx_queue_init(&qc->crypto[i].frames); | 697 ngx_queue_init(&qc->crypto[i].frames); |
697 } | 698 } |
2344 { | 2345 { |
2345 return NGX_ERROR; | 2346 return NGX_ERROR; |
2346 } | 2347 } |
2347 | 2348 |
2348 /* 13.2.3. Receiver Tracking of ACK Frames */ | 2349 /* 13.2.3. Receiver Tracking of ACK Frames */ |
2349 if (ctx->largest_ack < max) { | 2350 if (ctx->largest_ack < max || ctx->largest_ack == (uint64_t) -1) { |
2350 ctx->largest_ack = max; | 2351 ctx->largest_ack = max; |
2351 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | 2352 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, |
2352 "quic updated largest received ack: %uL", max); | 2353 "quic updated largest received ack: %uL", max); |
2353 | 2354 |
2354 /* | 2355 /* |