From: Maxim Dounin Date: Mon, 28 Jul 2014 14:30:14 +0000 (+0400) Subject: Upstream: SSL handshake timeouts. X-Git-Tag: release-1.7.4~14 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=4b2f12a60485661039bad8e334716eba7fbc7b24;p=nginx.git 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. --- diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 58edc62fd..18b04f775 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1393,6 +1393,11 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r, 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; }