changeset 5774:9bf58a3da25b

Upstream: SSL handshake timeouts. Timeout may not be set on an upstream connection when we call ngx_ssl_handshake() in ngx_http_upstream_ssl_init_connection(), so make sure to arm it if it's not set. Based on a patch by Yichun Zhang.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 28 Jul 2014 18:30:14 +0400
parents 494c2c2a0247
children 294d020bbcfe
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1393,6 +1393,11 @@ ngx_http_upstream_ssl_init_connection(ng
     rc = ngx_ssl_handshake(c);
 
     if (rc == NGX_AGAIN) {
+
+        if (!c->write->timer_set) {
+            ngx_add_timer(c->write, u->conf->connect_timeout);
+        }
+
         c->ssl->handler = ngx_http_upstream_ssl_handshake;
         return;
     }