aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFengGu <flygoast@126.com>2014-08-13 14:53:55 +0800
committerFengGu <flygoast@126.com>2014-08-13 14:53:55 +0800
commitb4cb8475b142c0a76e3aa2b715cd9429784dd27e (patch)
tree8e47fa97b71dbd75e73b90da69351ff9310b0b7a /src
parentcb8a0327ab689867f6ea9e05fcb3242883e83bc2 (diff)
downloadnginx-b4cb8475b142c0a76e3aa2b715cd9429784dd27e.tar.gz
nginx-b4cb8475b142c0a76e3aa2b715cd9429784dd27e.zip
Upstream: avoided directly terminating the connection.
When memory allocation failed in ngx_http_upstream_cache(), the connection would be terminated directly in ngx_http_upstream_init_request(). Return a INTERNAL_SERVER_ERROR response instead.
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_upstream.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 94dd466af..996dc8a85 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -519,6 +519,11 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
return;
}
+ if (rc == NGX_ERROR) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ return;
+ }
+
if (rc != NGX_DECLINED) {
ngx_http_finalize_request(r, rc);
return;