aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/proxy/ngx_http_proxy_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-09-28 19:29:06 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-09-28 19:29:06 +0000
commit2cdd7e9e5bd7c0ddcc5dbf57aa3ffb998fd3335f (patch)
tree6a2b3c17c58af5159ff80a1bcef94f7c93632967 /src/http/modules/proxy/ngx_http_proxy_handler.c
parent02f0132392913bd632d2616a0c0ab5391c2cfc6d (diff)
downloadnginx-2cdd7e9e5bd7c0ddcc5dbf57aa3ffb998fd3335f.tar.gz
nginx-2cdd7e9e5bd7c0ddcc5dbf57aa3ffb998fd3335f.zip
nginx-0.0.1-2003-09-28-23:29:06 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_handler.c')
-rw-r--r--src/http/modules/proxy/ngx_http_proxy_handler.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c
index 962dcbfbd..00f1e722e 100644
--- 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_request_t *r)
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(ngx_event_t *wev)
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;