diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-05-05 17:18:33 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-05-05 17:18:33 +0000 |
commit | 25870d8ea2c5b20de974c88ff2cc30bcd7d401bd (patch) | |
tree | e6a62c343854abfa29f2b7d243ae4f120b1c3a81 | |
parent | b4097d6093aa671da2e0681b36ddb63c5df45022 (diff) | |
download | nginx-25870d8ea2c5b20de974c88ff2cc30bcd7d401bd.tar.gz |
reinit proxy/fastcgi header parser before ngx_http_upstream_cache_send()
-rw-r--r-- | src/http/ngx_http_upstream.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 74c9b20f1..4913fe38a 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1472,6 +1472,7 @@ ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u) static ngx_int_t ngx_http_upstream_test_next(ngx_http_request_t *r, ngx_http_upstream_t *u) { + ngx_int_t rc; ngx_uint_t status; ngx_http_upstream_next_t *un; @@ -1491,8 +1492,14 @@ ngx_http_upstream_test_next(ngx_http_request_t *r, ngx_http_upstream_t *u) #if (NGX_HTTP_CACHE) if (u->stale_cache && (u->conf->cache_use_stale & un->mask)) { - ngx_http_upstream_finalize_request(r, u, - ngx_http_upstream_cache_send(r, u)); + + rc = u->reinit_request(r); + + if (rc == NGX_OK) { + rc = ngx_http_upstream_cache_send(r, u); + } + + ngx_http_upstream_finalize_request(r, u, rc); return NGX_OK; } @@ -2643,9 +2650,15 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u, #if (NGX_HTTP_CACHE) if (u->stale_cache && (u->conf->cache_use_stale & ft_type)) { + ngx_int_t rc; - ngx_http_upstream_finalize_request(r, u, - ngx_http_upstream_cache_send(r, u)); + rc = u->reinit_request(r); + + if (rc == NGX_OK) { + rc = ngx_http_upstream_cache_send(r, u); + } + + ngx_http_upstream_finalize_request(r, u, rc); return; } #endif |