diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-10-19 19:57:23 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-10-19 19:57:23 +0000 |
commit | 13829b7316411fa13c848015e1011a53405f37be (patch) | |
tree | a0b244ef460d4160a71b593ea8bc6f751466f21b /src/http/modules/proxy/ngx_http_proxy_handler.c | |
parent | 091f7d6e83b2ee38b44b15ff583f76e705baa43d (diff) | |
download | nginx-13829b7316411fa13c848015e1011a53405f37be.tar.gz nginx-13829b7316411fa13c848015e1011a53405f37be.zip |
nginx-0.0.1-2003-10-19-23:57:23 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_handler.c')
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_handler.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c index 58ce51a46..5f50563be 100644 --- a/src/http/modules/proxy/ngx_http_proxy_handler.c +++ b/src/http/modules/proxy/ngx_http_proxy_handler.c @@ -775,7 +775,7 @@ static void ngx_http_proxy_process_upstream(ngx_event_t *rev) return; } - if (ngx_event_proxy_read_upstream(p->event_proxy) == NGX_ABORT) { + if (ngx_event_proxy(p->event_proxy, 0) == NGX_ABORT) { ngx_http_proxy_finalize_request(p, 0); return; } @@ -784,7 +784,8 @@ static void ngx_http_proxy_process_upstream(ngx_event_t *rev) || p->event_proxy->upstream_error || p->event_proxy->upstream_done) { - ngx_http_proxy_finalize_request(p, ngx_http_send_last(p->request)); + ngx_http_proxy_close_connection(c); + p->upstream.connection = NULL; return; } @@ -795,11 +796,13 @@ static void ngx_http_proxy_process_upstream(ngx_event_t *rev) static void ngx_http_proxy_process_downstream(ngx_event_t *wev) { ngx_connection_t *c; + ngx_http_request_t *r; ngx_http_proxy_ctx_t *p; c = wev->data; - p = c->data; - + r = c->data; + p = ngx_http_get_module_ctx(r, ngx_http_proxy_module); + ngx_log_debug(wev->log, "http proxy process downstream"); if (wev->timedout) { @@ -807,13 +810,15 @@ static void ngx_http_proxy_process_downstream(ngx_event_t *wev) return; } - if (ngx_event_proxy_write_to_downstream(p->event_proxy) == NGX_ABORT) { + if (ngx_event_proxy(p->event_proxy, 1) == NGX_ABORT) { ngx_http_proxy_finalize_request(p, 0); return; } if (p->event_proxy->downstream_done) { - ngx_http_proxy_finalize_request(p, 0); +ngx_log_debug(wev->log, "http proxy downstream done"); + ngx_http_proxy_finalize_request(p, r->main ? 0: + ngx_http_send_last(p->request)); return; } |