Welcome! Log In Create A New Profile

Advanced

[nginx] Proxy: fixed proxy_set_body with proxy_cache.

Maxim Dounin
March 23, 2015 02:12PM
details: http://hg.nginx.org/nginx/rev/613b14b305c7
branches:
changeset: 6043:613b14b305c7
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Mar 23 19:28:54 2015 +0300
description:
Proxy: fixed proxy_set_body with proxy_cache.

If the last header evaluation resulted in an empty header, the e.skip flag
was set and was not reset when we've switched to evaluation of body_values.
This incorrectly resulted in body values being skipped instead of producing
some correct body as set by proxy_set_body. Fix is to properly reset
the e.skip flag.

As the problem only appeared if the last potentially non-empty header
happened to be empty, it only manifested itself if proxy_set_body was used
with proxy_cache.

diffstat:

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

diffs (11 lines):

diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1379,6 +1379,7 @@ ngx_http_proxy_create_request(ngx_http_r
if (plcf->body_values) {
e.ip = plcf->body_values->elts;
e.pos = b->last;
+ e.skip = 0;

while (*(uintptr_t *) e.ip) {
code = *(ngx_http_script_code_pt *) e.ip;

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

[nginx] Proxy: fixed proxy_set_body with proxy_cache.

Maxim Dounin 641 March 23, 2015 02:12PM



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

Online Users

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