From: Maxim Dounin Date: Mon, 23 Mar 2015 16:28:54 +0000 (+0300) Subject: Proxy: fixed proxy_set_body with proxy_cache. X-Git-Tag: release-1.7.11~11 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=58eb93f791d27482519161a9bdef00acd9b33298;p=nginx.git 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. --- diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 2409c7ec4..ac81b07af 100644 --- 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_request_t *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;