From: Sergey Kandaurov Date: Thu, 12 Nov 2026 19:30:20 +0000 (+0400) Subject: HTTP/2: fixed handling of INITIAL_WINDOW_SIZE with exceeding delta X-Git-Url: https://git.kaiwu.me/http/ngx_http_fastcgi_module.html?a=commitdiff_plain;h=46ee78a0800a63bb2bcdf0d0637c84b3e5b1e61a;p=nginx.git HTTP/2: fixed handling of INITIAL_WINDOW_SIZE with exceeding delta Per RFC 9113, Section 6.9.2, it is a connection error. --- diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 807dd59c1..23b72f2dd 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -2358,7 +2358,7 @@ ngx_http_v2_state_settings_params(ngx_http_v2_connection_t *h2c, u_char *pos, if (ngx_http_v2_adjust_windows(h2c, h2c->state.window_delta) != NGX_OK) { return ngx_http_v2_connection_error(h2c, - NGX_HTTP_V2_INTERNAL_ERROR); + NGX_HTTP_V2_FLOW_CTRL_ERROR); } h2c->state.window_delta = 0; @@ -5069,14 +5069,13 @@ ngx_http_v2_adjust_windows(ngx_http_v2_connection_t *h2c, ssize_t delta) && stream->send_window > (ssize_t) (NGX_HTTP_V2_MAX_WINDOW - delta)) { - if (ngx_http_v2_terminate_stream(h2c, stream, - NGX_HTTP_V2_FLOW_CTRL_ERROR) - == NGX_ERROR) - { - return NGX_ERROR; - } - - continue; + ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0, + "client violated flow control for stream %ui: " + "received INITIAL_WINDOW_SIZE " + "with window increment %uz " + "not allowed for window %z", + node->id, delta, stream->send_window); + return NGX_ERROR; } stream->send_window += delta;