From: FengGu Date: Wed, 13 Aug 2014 06:53:55 +0000 (+0800) Subject: Upstream: avoided directly terminating the connection. X-Git-Tag: release-1.7.5~9 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=b4cb8475b142c0a76e3aa2b715cd9429784dd27e;p=nginx.git 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. --- 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;