[PATCH 06 of 10] QUIC: do not send MAX_STREAMS in shutdown state

Roman Arutyunyan arut at nginx.com
Thu Sep 8 09:06:33 UTC 2022


# HG changeset patch
# User Roman Arutyunyan <arut at nginx.com>
# Date 1662541976 -14400
#      Wed Sep 07 13:12:56 2022 +0400
# Branch quic
# Node ID 28437cb91bd8624b30a4c841852504110b0f3f7d
# Parent  b83d00cbc660b426e4f43ac698345ebbd13215e1
QUIC: do not send MAX_STREAMS in shutdown state.

No more streams are expected from client.

diff --git a/src/event/quic/ngx_event_quic_streams.c b/src/event/quic/ngx_event_quic_streams.c
--- a/src/event/quic/ngx_event_quic_streams.c
+++ b/src/event/quic/ngx_event_quic_streams.c
@@ -1072,6 +1072,15 @@ ngx_quic_close_stream(ngx_quic_stream_t 
         return NGX_OK;
     }
 
+    if (!pc->reusable && ngx_quic_can_shutdown(pc) == NGX_OK) {
+        ngx_reusable_connection(pc, 1);
+    }
+
+    if (qc->shutdown) {
+        ngx_quic_shutdown_quic(pc);
+        return NGX_OK;
+    }
+
     if ((qs->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0) {
         frame = ngx_quic_alloc_frame(pc);
         if (frame == NULL) {
@@ -1093,14 +1102,6 @@ ngx_quic_close_stream(ngx_quic_stream_t 
         ngx_quic_queue_frame(qc, frame);
     }
 
-    if (!pc->reusable && ngx_quic_can_shutdown(pc) == NGX_OK) {
-        ngx_reusable_connection(pc, 1);
-    }
-
-    if (qc->shutdown) {
-        ngx_quic_shutdown_quic(pc);
-    }
-
     return NGX_OK;
 }
 



More information about the nginx-devel mailing list