[nginx] Upstream: handling of upstream SSL handshake timeouts.

Maxim Dounin mdounin at mdounin.ru
Mon Nov 14 14:25:11 UTC 2016


details:   http://hg.nginx.org/nginx/rev/d8d037f20484
branches:  
changeset: 6799:d8d037f20484
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Nov 14 17:21:06 2016 +0300
description:
Upstream: handling of upstream SSL handshake timeouts.

Previously SSL handshake timeouts were not properly logged, and resulted
in 502 errors instead of 504 (ticket #1126).

diffstat:

 src/http/ngx_http_upstream.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1666,6 +1666,13 @@ ngx_http_upstream_ssl_handshake(ngx_conn
         return;
     }
 
+    if (c->write->timedout) {
+        c = r->connection;
+        ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_TIMEOUT);
+        ngx_http_run_posted_requests(c);
+        return;
+    }
+
 failed:
 
     c = r->connection;



More information about the nginx-devel mailing list