]> git.kaiwu.me - nginx.git/commitdiff
QUIC: apply stream flow control to RESET_STREAM final_size
authorRoman Arutyunyan <arut@nginx.com>
Thu, 23 Jul 2026 07:33:13 +0000 (11:33 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Wed, 29 Jul 2026 16:14:43 +0000 (20:14 +0400)
Previously, stream flow control was not applied to the RESET_STREAM
final_size, which allowed a client to exceed it.  The excess had to be
within the connection flow control limits anyway.

Reported by Tony Wang.

src/event/quic/ngx_event_quic_streams.c

index 18fffeabe4f76042c3dbf3673c0a1ed8d445009b..bc2b4014bf0c9db650cbae8553aae51199b80167 100644 (file)
@@ -1481,8 +1481,6 @@ ngx_quic_handle_reset_stream_frame(ngx_connection_t *c,
         return NGX_OK;
     }
 
-    qs->recv_state = NGX_QUIC_STREAM_RECV_RESET_RECVD;
-
     if (ngx_quic_control_flow(qs, f->final_size) != NGX_OK) {
         return NGX_ERROR;
     }
@@ -1500,6 +1498,7 @@ ngx_quic_handle_reset_stream_frame(ngx_connection_t *c,
     }
 
     qs->recv_final_size = f->final_size;
+    qs->recv_state = NGX_QUIC_STREAM_RECV_RESET_RECVD;
 
     if (ngx_quic_update_flow(qs, qs->recv_final_size) != NGX_OK) {
         return NGX_ERROR;