]> git.kaiwu.me - nginx.git/commitdiff
QUIC: do not call shutdown() when handshake is in progress.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 21 Sep 2023 15:32:38 +0000 (19:32 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 21 Sep 2023 15:32:38 +0000 (19:32 +0400)
Instead, when worker is shutting down and handshake is not yet completed,
connection is terminated immediately.

Previously the callback could be called while QUIC handshake was in progress
and, what's more important, before the init() callback.  Now it's postponed
after init().

This change is a preparation to postponing HTTP/3 session creation to init().

src/event/quic/ngx_event_quic.c

index 0032a5505660f1a65d1203e49591e866cad75123..b23434c0edf7278ea0f705b3abacbd9a1fb23cc1 100644 (file)
@@ -420,7 +420,7 @@ ngx_quic_input_handler(ngx_event_t *rev)
     if (c->close) {
         c->close = 0;
 
-        if (!ngx_exiting) {
+        if (!ngx_exiting || !qc->streams.initialized) {
             qc->error = NGX_QUIC_ERR_NO_ERROR;
             qc->error_reason = "graceful shutdown";
             ngx_quic_close_connection(c, NGX_ERROR);