]> git.kaiwu.me - nginx.git/commitdiff
QUIC: use client max_ack_delay when computing pto timeout.
authorRoman Arutyunyan <arut@nginx.com>
Wed, 9 Dec 2020 16:15:24 +0000 (16:15 +0000)
committerRoman Arutyunyan <arut@nginx.com>
Wed, 9 Dec 2020 16:15:24 +0000 (16:15 +0000)
Previously, server max_ack_delay was used which is wrong.

Also, level check is simplified.

src/event/ngx_event_quic.c

index ace2de7499040ba66b1837cc48a87946bcacdfb1..fef4286251fb964c384cda272bfbec4180774ee6 100644 (file)
@@ -3423,10 +3423,8 @@ ngx_quic_pto(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx)
         return duration;
     }
 
-    if (ctx == &qc->send_ctx[2] && c->ssl->handshaked) {
-        /* application send space */
-
-        duration += qc->tp.max_ack_delay << qc->pto_count;
+    if (ctx->level == ssl_encryption_application && c->ssl->handshaked) {
+        duration += qc->ctp.max_ack_delay << qc->pto_count;
     }
 
     return duration;