aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/proxy/ngx_http_proxy_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-10-08 04:34:07 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-10-08 04:34:07 +0000
commitfd3e374a02c7fc98d8193222885b453084f87727 (patch)
tree3adbd9ead98652e0d3ba4159b08993b8355543bf /src/http/modules/proxy/ngx_http_proxy_handler.c
parent931a400cf1302d6f4cd220325383a37743eed592 (diff)
downloadnginx-fd3e374a02c7fc98d8193222885b453084f87727.tar.gz
nginx-fd3e374a02c7fc98d8193222885b453084f87727.zip
nginx-0.0.1-2003-10-08-08:34:07 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_handler.c')
-rw-r--r--src/http/modules/proxy/ngx_http_proxy_handler.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c
index 2888e4cfa..9333c954c 100644
--- a/src/http/modules/proxy/ngx_http_proxy_handler.c
+++ b/src/http/modules/proxy/ngx_http_proxy_handler.c
@@ -779,12 +779,25 @@ static void ngx_http_proxy_process_upstream_body(ngx_event_t *rev)
ngx_log_debug(rev->log, "http proxy process upstream body");
if (rev->timedout) {
- ngx_http_proxy_next_upstream(p);
+ ngx_http_proxy_close_connection(p->upstream.connection);
+ p->upstream.connection = NULL;
return;
}
ngx_event_proxy_read_upstream(p->event_proxy);
+ if (p->event_proxy->upstream_eof) {
+ ngx_http_proxy_close_connection(p->upstream.connection);
+ p->upstream.connection = NULL;
+ return;
+ }
+
+ if (p->event_proxy->upstream_error) {
+ ngx_http_proxy_close_connection(p->upstream.connection);
+ p->upstream.connection = NULL;
+ return;
+ }
+
return;
}
@@ -1043,6 +1056,8 @@ static void ngx_http_proxy_close_connection(ngx_connection_t *c)
c->write->timer_set = 0;
}
+ /* TODO: move connection to the connection pool */
+
if (ngx_del_conn) {
ngx_del_conn(c);