]> git.kaiwu.me - nginx.git/commitdiff
QUIC: do not arm loss detection timer if nothing was sent.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 2 Feb 2022 12:57:08 +0000 (15:57 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 2 Feb 2022 12:57:08 +0000 (15:57 +0300)
Notably, this became quite practicable after the recent fix in cd8018bc81a5.

Additionally, do not arm loss detection timer on connection termination.

src/event/quic/ngx_event_quic_output.c

index 103dd0e5ce68e461cff9537464fe2ce19410a6ce..ebfe0cfc20d53ecd5f6e8217e8da795227f47e91 100644 (file)
@@ -104,7 +104,12 @@ ngx_quic_output(ngx_connection_t *c)
         return NGX_ERROR;
     }
 
-    if (in_flight != cg->in_flight && !qc->send_timer_set && !qc->closing) {
+    if (in_flight == cg->in_flight || qc->closing) {
+        /* no ack-eliciting data was sent or we are done */
+        return NGX_OK;
+    }
+
+    if (!qc->send_timer_set) {
         qc->send_timer_set = 1;
         ngx_add_timer(c->read, qc->tp.max_idle_timeout);
     }