]> git.kaiwu.me - nginx.git/commitdiff
Upstream: handling of upstream SSL handshake timeouts.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 14 Nov 2016 14:21:06 +0000 (17:21 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 14 Nov 2016 14:21:06 +0000 (17:21 +0300)
Previously SSL handshake timeouts were not properly logged, and resulted
in 502 errors instead of 504 (ticket #1126).

src/http/ngx_http_upstream.c

index a6dd55e662e0158c2f7f518d134211426bbc13fe..ed25f438dc4b12866bba8061c68c93beed48ecda 100644 (file)
@@ -1666,6 +1666,13 @@ ngx_http_upstream_ssl_handshake(ngx_connection_t *c)
         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;