Welcome! Log In Create A New Profile

Advanced

[nginx] Proxy: fixed proxy_request_buffering and chunked with pr...

Roman Arutyunyan
March 26, 2015 09:04AM
details: http://hg.nginx.org/nginx/rev/24ccec3c4a87
branches:
changeset: 6056:24ccec3c4a87
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Mar 26 02:31:30 2015 +0300
description:
Proxy: fixed proxy_request_buffering and chunked with preread body.

If any preread body bytes were sent in the first chain, chunk size was
incorrectly added before the whole chain, including header, resulting in
an invalid request sent to upstream. Fixed to properly add chunk size
after the header.

diffstat:

src/http/modules/ngx_http_proxy_module.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 166c2c19c522 -r 24ccec3c4a87 src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c Tue Mar 24 18:45:34 2015 +0300
+++ b/src/http/modules/ngx_http_proxy_module.c Thu Mar 26 02:31:30 2015 +0300
@@ -1503,7 +1503,7 @@ ngx_http_proxy_body_output_filter(void *
u_char *chunk;
ngx_int_t rc;
ngx_buf_t *b;
- ngx_chain_t *out, *cl, *tl, **ll;
+ ngx_chain_t *out, *cl, *tl, **ll, **fl;
ngx_http_proxy_ctx_t *ctx;

ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -1546,6 +1546,7 @@ ngx_http_proxy_body_output_filter(void *

size = 0;
cl = in;
+ fl = ll;

for ( ;; ) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -1602,8 +1603,8 @@ ngx_http_proxy_body_output_filter(void *
b->pos = chunk;
b->last = ngx_sprintf(chunk, "%xO" CRLF, size);

- tl->next = out;
- out = tl;
+ tl->next = *fl;
+ *fl = tl;
}

if (cl->buf->last_buf) {

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

[nginx] Proxy: fixed proxy_request_buffering and chunked with pr...

Roman Arutyunyan 732 March 26, 2015 09:04AM



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

Online Users

Guests: 321
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