diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-04-02 05:14:40 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-04-02 05:14:40 +0000 |
commit | debb39eaedf46e63d22f4604da01cf26a1e8a930 (patch) | |
tree | 20890aefc18462a802e6f71951a3ae470b93e4d2 /src/http/modules/proxy/ngx_http_proxy_upstream.c | |
parent | dbb27765706e2d2f35b0af57c317b58d2d9d6ec9 (diff) | |
download | nginx-debb39eaedf46e63d22f4604da01cf26a1e8a930.tar.gz nginx-debb39eaedf46e63d22f4604da01cf26a1e8a930.zip |
nginx-0.0.3-2004-04-02-09:14:40 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_upstream.c')
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_upstream.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_upstream.c b/src/http/modules/proxy/ngx_http_proxy_upstream.c index bd4befd76..d27975919 100644 --- a/src/http/modules/proxy/ngx_http_proxy_upstream.c +++ b/src/http/modules/proxy/ngx_http_proxy_upstream.c @@ -1199,14 +1199,16 @@ static void ngx_http_proxy_send_response(ngx_http_proxy_ctx_t *p) ep->preread_size = p->header_in->last - p->header_in->pos; - ep->hunk_to_file = ngx_calloc_hunk(r->pool); - if (ep->preread_hunks == NULL) { - ngx_http_proxy_finalize_request(p, 0); - return; + if (p->cachable) { + ep->hunk_to_file = ngx_calloc_hunk(r->pool); + if (ep->hunk_to_file == NULL) { + ngx_http_proxy_finalize_request(p, 0); + return; + } + ep->hunk_to_file->pos = p->header_in->start; + ep->hunk_to_file->last = p->header_in->pos; + ep->hunk_to_file->type = NGX_HUNK_IN_MEMORY|NGX_HUNK_TEMP; } - ep->hunk_to_file->pos = p->header_in->start; - ep->hunk_to_file->last = p->header_in->pos; - ep->hunk_to_file->type = NGX_HUNK_IN_MEMORY|NGX_HUNK_TEMP; if (ngx_event_flags & NGX_USE_AIO_EVENT) { /* the posted aio operation can currupt a shadow buffer */ |