diff src/http/modules/proxy/ngx_http_proxy_handler.c @ 135:e29909bd9b8a

nginx-0.0.1-2003-09-28-23:29:06 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 28 Sep 2003 19:29:06 +0000
parents 049e78b1f852
children da00cde00e8a
line wrap: on
line diff
--- a/src/http/modules/proxy/ngx_http_proxy_handler.c
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.c
@@ -79,11 +79,11 @@ int ngx_http_proxy_handler(ngx_http_requ
 
         if (rc == NGX_OK) {
             ngx_http_proxy_send_request(p->upstream.connection->write);
-            /* ??? */ return NGX_OK;
+            return NGX_OK;
         }
 
         if (rc == NGX_AGAIN) {
-            /* ??? */ return NGX_OK;
+            /* TODO */ return NGX_OK;
         }
 
         /* rc == NGX_CONNECT_FAILED */
@@ -116,9 +116,22 @@ static void ngx_http_proxy_send_request(
                 rc = ngx_event_connect_peer(&p->upstream);
 
                 if (rc == NGX_OK) {
-#if 0
-                    copy chain and hunks p->request_hunks from p->initial_request_hunks;
-#endif
+
+                    /* copy chain and hunks p->request_hunks
+                       from p->initial_request_hunks */
+
+                    p->request_hunks = NULL;
+                    if (ngx_chain_add_copy(r->pool, p->request_hunks,
+                                        p->initial_request_hunks) == NGX_ERROR)
+                    {
+                        return NGX_HTTP_INTERNAL_SERVER_ERROR;
+                    }
+
+                    for (ce = p->request_hunks; ce; ce = ce->next) {
+                        ce->hunk->pos = ce->hunk->start;
+                    }
+
+
                     c = p->connection;
                     wev = c->write;