diff options
| author | Roman Arutyunyan <arut@nginx.com> | 2024-05-23 19:15:38 +0400 |
|---|---|---|
| committer | Roman Arutyunyan <arut@nginx.com> | 2024-05-23 19:15:38 +0400 |
| commit | ea8270c6142869367c5608bff92df9f5b3f32d37 (patch) | |
| tree | 557609f647241cce51a07aa3a71a060bf8dc86cc /src/http/modules/ngx_http_grpc_module.c | |
| parent | efc6a217b92985a1ee211b6bb7337cd2f62deb90 (diff) | |
| download | nginx-ea8270c6142869367c5608bff92df9f5b3f32d37.tar.gz nginx-ea8270c6142869367c5608bff92df9f5b3f32d37.tar.bz2 | |
Optimized chain link usage (ticket #2614).
Previously chain links could sometimes be dropped instead of being reused,
which could result in increased memory consumption during long requests.
A similar chain link issue in ngx_http_gzip_filter_module was fixed in
da46bfc484ef (1.11.10).
Based on a patch by Sangmin Lee.
Diffstat (limited to 'src/http/modules/ngx_http_grpc_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_grpc_module.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_grpc_module.c b/src/http/modules/ngx_http_grpc_module.c index dfe49c586..e7726f314 100644 --- a/src/http/modules/ngx_http_grpc_module.c +++ b/src/http/modules/ngx_http_grpc_module.c @@ -1231,7 +1231,7 @@ ngx_http_grpc_body_output_filter(void *data, ngx_chain_t *in) ngx_buf_t *b; ngx_int_t rc; ngx_uint_t next, last; - ngx_chain_t *cl, *out, **ll; + ngx_chain_t *cl, *out, *ln, **ll; ngx_http_upstream_t *u; ngx_http_grpc_ctx_t *ctx; ngx_http_grpc_frame_t *f; @@ -1459,7 +1459,10 @@ ngx_http_grpc_body_output_filter(void *data, ngx_chain_t *in) last = 1; } + ln = in; in = in->next; + + ngx_free_chain(r->pool, ln); } ctx->in = in; |
