]> git.kaiwu.me - nginx.git/commitdiff
QUIC: simplified setting close timer when closing connection.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 14 Sep 2023 10:15:20 +0000 (14:15 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 14 Sep 2023 10:15:20 +0000 (14:15 +0400)
Previously, the timer was never reset due to an explicit check.  The check was
added in 36b59521a41c as part of connection close simplification.  The reason
was to retain the earliest timeout.  However, the timeouts are all the same
while QUIC handshake is in progress and resetting the timer for the same value
has no performance implications.  After handshake completion there's only
application level.  The change removes the check.

src/event/quic/ngx_event_quic.c

index b23434c0edf7278ea0f705b3abacbd9a1fb23cc1..df3833e91e1d0f3d9ce7e30799e15fa86a2423da 100644 (file)
@@ -537,7 +537,7 @@ ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc)
                 qc->error_level = ctx->level;
                 (void) ngx_quic_send_cc(c);
 
-                if (rc == NGX_OK && !qc->close.timer_set) {
+                if (rc == NGX_OK) {
                     ngx_add_timer(&qc->close, 3 * ngx_quic_pto(c, ctx));
                 }
             }