diff src/http/modules/proxy/ngx_http_proxy_upstream.c @ 187:5a9bbe99008b

nginx-0.0.1-2003-11-17-19:15:03 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 17 Nov 2003 16:15:03 +0000
parents a8ff48d26cca
children 0061d1f0908d
line wrap: on
line diff
--- a/src/http/modules/proxy/ngx_http_proxy_upstream.c
+++ b/src/http/modules/proxy/ngx_http_proxy_upstream.c
@@ -956,10 +956,18 @@ static void ngx_http_proxy_send_response
     }
     ep->preread_hunks->hunk = p->header_in;
     ep->preread_hunks->next = NULL;
-    p->header_in->type |= NGX_HUNK_PREREAD;
 
     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;
+    }
+    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 shadow buf */