]> git.kaiwu.me - nginx.git/commitdiff
Proxy: fixed sending HTTP/2 buffered request body on next upstream.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 24 Dec 2025 18:59:40 +0000 (22:59 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Thu, 29 Jan 2026 10:52:41 +0000 (14:52 +0400)
If a buffered request body wasn't fully sent, such as on early upstream
response or limited by flow control, unsent buffers could remain in the
input or busy chains when switching to the next upstream server.  This
resulted either in the invalid request sent or a stalled connection.

The fix is to reset chains similar to ngx_http_upstream_reinit().

src/http/modules/ngx_http_proxy_v2_module.c

index 17983a29d1538eb819396542e8e0d01bf5aceef6..f109fe94e7c239a60921d55f01c51b0a1cf49fce 100644 (file)
@@ -944,6 +944,8 @@ ngx_http_proxy_v2_reinit_request(ngx_http_request_t *r)
     ctx->rst = 0;
     ctx->goaway = 0;
     ctx->connection = NULL;
+    ctx->in = NULL;
+    ctx->busy = NULL;
 
     return NGX_OK;
 }