]> git.kaiwu.me - nginx.git/commitdiff
QUIC: disabled non-immediate ACKs for Initial and Handshake.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 4 Feb 2021 17:39:47 +0000 (20:39 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 4 Feb 2021 17:39:47 +0000 (20:39 +0300)
As per quic-transport-33:

   An endpoint MUST acknowledge all ack-eliciting Initial and Handshake
   packets immediately

If a packet carrying Initial or Handshake ACK was lost, a non-immediate ACK
should not be sent later.  Instead, client is expected to send a new packet
to acknowledge.

Sending non-immediate ACKs for Initial packets can cause the client to
generate an inflated RTT sample.

src/event/quic/ngx_event_quic.c

index 6159e87e16ceb47a497d1031debfdb4b66704233..7e6c60ef026aa74b657248959efae8e944308cf1 100644 (file)
@@ -5527,8 +5527,11 @@ ngx_quic_resend_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx)
         switch (f->type) {
         case NGX_QUIC_FT_ACK:
         case NGX_QUIC_FT_ACK_ECN:
-            /* force generation of most recent acknowledgment */
-            ctx->send_ack = NGX_QUIC_MAX_ACK_GAP;
+            if (ctx->level == ssl_encryption_application) {
+                /* force generation of most recent acknowledgment */
+                ctx->send_ack = NGX_QUIC_MAX_ACK_GAP;
+            }
+
             ngx_quic_free_frame(c, f);
             break;