]> git.kaiwu.me - nginx.git/commitdiff
gRPC: reset buffer chains on upstream reinit.
authorDavid Carlier <devnexen@gmail.com>
Fri, 20 Feb 2026 05:08:09 +0000 (05:08 +0000)
committerSergey Kandaurov <s.kandaurov@f5.com>
Mon, 16 Mar 2026 07:38:06 +0000 (11:38 +0400)
Previously, ctx->out was not cleared in ngx_http_grpc_reinit_request(),
which could cause queued HTTP/2 control frames (SETTINGS ACK, PING ACK,
WINDOW_UPDATE) to be sent on next upstream.

Additionally, ctx->in and ctx->busy needs to be cleared to avoid similar
problems with buffered request body fixed in cd12dc4f1.

src/http/modules/ngx_http_grpc_module.c

index 4c95525b46980096013420f778575271ec8199ac..cc3aebe59496228ce289069cb60e29a39a085fdd 100644 (file)
@@ -1224,6 +1224,9 @@ ngx_http_grpc_reinit_request(ngx_http_request_t *r)
     ctx->rst = 0;
     ctx->goaway = 0;
     ctx->connection = NULL;
+    ctx->in = NULL;
+    ctx->busy = NULL;
+    ctx->out = NULL;
 
     return NGX_OK;
 }