diff options
| author | Roman Arutyunyan <arut@nginx.com> | 2020-12-10 14:54:53 +0000 |
|---|---|---|
| committer | Roman Arutyunyan <arut@nginx.com> | 2020-12-10 14:54:53 +0000 |
| commit | 4fd02c58391ed65a4567e16bee6d198670f2539a (patch) | |
| tree | 4f285e16871bdd7895f58d2653eb6c39220c811b | |
| parent | 6f9efd423ed225bf1cf25f173aaf99cbedc57e3f (diff) | |
| download | nginx-4fd02c58391ed65a4567e16bee6d198670f2539a.tar.gz nginx-4fd02c58391ed65a4567e16bee6d198670f2539a.tar.bz2 | |
QUIC: send and process ack_delay for Initial and Handshake levels.
Previously, this only worked for Application level because before
quic-transport-30, there were the following constraints:
Because the receiver doesn't use the ACK Delay for Initial and Handshake
packets, a sender SHOULD send a value of 0.
When adjusting an RTT sample using peer-reported acknowledgement delays, an
endpoint ... MUST ignore the ACK Delay field of the ACK frame for packets
sent in the Initial and Handshake packet number space.
| -rw-r--r-- | src/event/ngx_event_quic.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index fef428625..349fbb311 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -3024,14 +3024,9 @@ ngx_quic_send_ack(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx) qc = ngx_quic_get_connection(c); - if (ctx->level == ssl_encryption_application) { - ack_delay = ngx_current_msec - ctx->largest_received; - ack_delay *= 1000; - ack_delay >>= qc->ctp.ack_delay_exponent; - - } else { - ack_delay = 0; - } + ack_delay = ngx_current_msec - ctx->largest_received; + ack_delay *= 1000; + ack_delay >>= qc->ctp.ack_delay_exponent; frame = ngx_quic_alloc_frame(c); if (frame == NULL) { @@ -3379,13 +3374,10 @@ ngx_quic_rtt_sample(ngx_connection_t *c, ngx_quic_ack_frame_t *ack, } else { qc->min_rtt = ngx_min(qc->min_rtt, latest_rtt); + ack_delay = ack->delay * (1 << qc->ctp.ack_delay_exponent) / 1000; - if (level == ssl_encryption_application) { - ack_delay = ack->delay * (1 << qc->ctp.ack_delay_exponent) / 1000; + if (c->ssl->handshaked) { ack_delay = ngx_min(ack_delay, qc->ctp.max_ack_delay); - - } else { - ack_delay = 0; } adjusted_rtt = latest_rtt; |
