aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-12-09 21:26:21 +0000
committerRoman Arutyunyan <arut@nginx.com>2020-12-09 21:26:21 +0000
commit240f8a918ed09e67570020261b1693907e5b64c0 (patch)
tree7678191fee624a18cf220403432ec3b3e7686a50 /src
parent4fd02c58391ed65a4567e16bee6d198670f2539a (diff)
downloadnginx-240f8a918ed09e67570020261b1693907e5b64c0.tar.gz
nginx-240f8a918ed09e67570020261b1693907e5b64c0.zip
QUIC: always calculate rtt for largest acknowledged packet.
Previously, when processing client ACK, rtt could be calculated for a packet different than the largest if it was missing in the sent chain. Even though this is an unlikely situation, rtt based on a different packet could be larger than needed leading to bigger pto timeout and performance degradation.
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_quic.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c
index 349fbb311..73519b968 100644
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -3276,7 +3276,6 @@ static ngx_int_t
ngx_quic_handle_ack_frame_range(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
uint64_t min, uint64_t max, ngx_msec_t *send_time)
{
- uint64_t found_num;
ngx_uint_t found;
ngx_queue_t *q;
ngx_quic_frame_t *f;
@@ -3286,7 +3285,6 @@ ngx_quic_handle_ack_frame_range(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
*send_time = NGX_TIMER_INFINITE;
found = 0;
- found_num = 0;
q = ngx_queue_last(&ctx->sent);
@@ -3316,9 +3314,8 @@ ngx_quic_handle_ack_frame_range(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
break;
}
- if (f->pnum > found_num || !found) {
+ if (f->pnum == max) {
*send_time = f->last;
- found_num = f->pnum;
}
ngx_queue_remove(&f->queue);