# HG changeset patch # User Maxim Dounin # Date 1374749780 -14400 # Node ID 1ccdda1f37f3c1b4b721ae36766fe2a5dd1f9ff8 # Parent a489c31c9783df8b8e7a45e8d3bbfb3b2a68bfa8 Upstream: NGX_HTTP_GATEWAY_TIME_OUT after upstream timeouts. There is no real difference from previously used 0 as NGX_HTTP_* will become 0 in ngx_http_upstream_finalize_request(), but the change preserves information about a timeout a bit longer. Previous use of ETIMEDOUT in one place was just wrong. Note well that with cacheable responses there will be a difference (code in ngx_http_upstream_finalize_request() will store the error in cache), though this change doesn't touch cacheable case. diff -r a489c31c9783 -r 1ccdda1f37f3 src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c Thu Jul 25 14:56:13 2013 +0400 +++ b/src/http/ngx_http_upstream.c Thu Jul 25 14:56:20 2013 +0400 @@ -2018,7 +2018,7 @@ if (rev->timedout) { ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); - ngx_http_upstream_finalize_request(r, u, NGX_ETIMEDOUT); + ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT); return; } @@ -2514,7 +2514,7 @@ if (upstream->read->timedout || upstream->write->timedout) { ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); - ngx_http_upstream_finalize_request(r, u, 0); + ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT); return; } @@ -2701,7 +2701,7 @@ if (c->read->timedout) { ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out"); - ngx_http_upstream_finalize_request(r, u, 0); + ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT); return; }