[nginx] Upstream: reliably detect connection failures with SSL p...

Ruslan Ermilov ru at nginx.com
Mon Jul 29 10:55:09 UTC 2013


details:   http://hg.nginx.org/nginx/rev/12b750d35162
branches:  
changeset: 5305:12b750d35162
user:      Ruslan Ermilov <ru at nginx.com>
date:      Mon Jul 29 13:23:16 2013 +0400
description:
Upstream: reliably detect connection failures with SSL peers.

diffstat:

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

diffs (15 lines):

diff -r d3eab5e2df5f -r 12b750d35162 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Thu Jul 25 15:00:41 2013 +0400
+++ b/src/http/ngx_http_upstream.c	Mon Jul 29 13:23:16 2013 +0400
@@ -1282,6 +1282,11 @@ ngx_http_upstream_ssl_init_connection(ng
 {
     ngx_int_t   rc;
 
+    if (ngx_http_upstream_test_connect(c) != NGX_OK) {
+        ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
+        return;
+    }
+
     if (ngx_ssl_create_connection(u->conf->ssl, c,
                                   NGX_SSL_BUFFER|NGX_SSL_CLIENT)
         != NGX_OK)



More information about the nginx-devel mailing list