Proxy: fixed sending HTTP/2 buffered request body on next upstream.

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().
This commit is contained in:
Sergey Kandaurov 2025-12-24 22:59:40 +04:00 committed by Sergey Kandaurov
parent 349c72e858
commit cd12dc4f12

View 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;
}