# HG changeset patch # User Igor Sysoev # Date 1311341416 0 # Node ID 10fbb8f02a45ef17f522e45458eaaffcf90ec4da # Parent df2ae4bc74153228d5a72bbe1a46c3c7dcf8db87 finalizing with rc == 0 in unbuffered proxy mode caused nginx to wait for another send_timeout before actually closing client's connection if client timed out while still talking to upstream server patch by Maxim Dounin diff -r df2ae4bc7415 -r 10fbb8f02a45 src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c Fri Jul 22 12:53:04 2011 +0000 +++ b/src/http/ngx_http_upstream.c Fri Jul 22 13:30:16 2011 +0000 @@ -2317,7 +2317,7 @@ if (wev->timedout) { c->timedout = 1; ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out"); - ngx_http_upstream_finalize_request(r, u, 0); + ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT); return; } @@ -3013,6 +3013,7 @@ #endif if (u->header_sent + && rc != NGX_HTTP_REQUEST_TIME_OUT && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE)) { rc = 0;