diff options
author | FengGu <flygoast@126.com> | 2014-08-13 14:53:55 +0800 |
---|---|---|
committer | FengGu <flygoast@126.com> | 2014-08-13 14:53:55 +0800 |
commit | b4cb8475b142c0a76e3aa2b715cd9429784dd27e (patch) | |
tree | 8e47fa97b71dbd75e73b90da69351ff9310b0b7a /src | |
parent | cb8a0327ab689867f6ea9e05fcb3242883e83bc2 (diff) | |
download | nginx-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.c | 5 |
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; |