2014-07-28 20:08:39 +00:00
|
|
|
details: http://hg.nginx.org/nginx/rev/9bf58a3da25b
|
|
|
|
branches:
|
|
|
|
changeset: 5774:9bf58a3da25b
|
|
|
|
user: Maxim Dounin <mdounin@mdounin.ru>
|
|
|
|
date: Mon Jul 28 18:30:14 2014 +0400
|
|
|
|
description:
|
|
|
|
Upstream: SSL handshake timeouts.
|
2014-07-23 00:10:22 +00:00
|
|
|
|
2014-07-28 20:08:39 +00:00
|
|
|
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.
|
2014-07-23 00:10:22 +00:00
|
|
|
|
2014-07-28 20:08:39 +00:00
|
|
|
Based on a patch by Yichun Zhang.
|
|
|
|
|
|
|
|
diffstat:
|
|
|
|
|
|
|
|
src/http/ngx_http_upstream.c | 5 +++++
|
|
|
|
1 files changed, 5 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
diffs (15 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
|
|
|
|
@@ -1393,6 +1393,11 @@ ngx_http_upstream_ssl_init_connection(ng
|
2014-07-23 00:10:22 +00:00
|
|
|
rc = ngx_ssl_handshake(c);
|
2014-07-28 20:08:39 +00:00
|
|
|
|
2014-07-23 00:10:22 +00:00
|
|
|
if (rc == NGX_AGAIN) {
|
2014-07-28 20:08:39 +00:00
|
|
|
+
|
|
|
|
+ if (!c->write->timer_set) {
|
|
|
|
+ ngx_add_timer(c->write, u->conf->connect_timeout);
|
|
|
|
+ }
|
|
|
|
+
|
2014-07-23 00:10:22 +00:00
|
|
|
c->ssl->handler = ngx_http_upstream_ssl_handshake;
|
|
|
|
return;
|
|
|
|
}
|