Welcome! Log In Create A New Profile

Advanced

[nginx] Request body: free chain links in ngx_http_write_request...

Maxim Dounin
March 23, 2015 02:12PM
details: http://hg.nginx.org/nginx/rev/e2e609f59094
branches:
changeset: 6047:e2e609f59094
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Mar 23 21:09:12 2015 +0300
description:
Request body: free chain links in ngx_http_write_request_body().

diffstat:

src/http/ngx_http_request_body.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diffs (27 lines):

diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -415,7 +415,7 @@ static ngx_int_t
ngx_http_write_request_body(ngx_http_request_t *r)
{
ssize_t n;
- ngx_chain_t *cl;
+ ngx_chain_t *cl, *ln;
ngx_temp_file_t *tf;
ngx_http_request_body_t *rb;
ngx_http_core_loc_conf_t *clcf;
@@ -478,8 +478,13 @@ ngx_http_write_request_body(ngx_http_req

/* mark all buffers as written */

- for (cl = rb->bufs; cl; cl = cl->next) {
+ for (cl = rb->bufs; cl; /* void */) {
+
cl->buf->pos = cl->buf->last;
+
+ ln = cl;
+ cl = cl->next;
+ ngx_free_chain(r->pool, ln);
}

rb->bufs = NULL;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Request body: free chain links in ngx_http_write_request...

Maxim Dounin 455 March 23, 2015 02:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready