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.
This commit is contained in:
FengGu 2014-08-13 14:53:55 +08:00
parent cb8a0327ab
commit b4cb8475b1

View File

@ -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;