[nginx] Stream: detect port absence in proxy_pass with IP literal.

Roman Arutyunyan arut at nginx.com
Wed Mar 23 14:52:31 UTC 2016


details:   http://hg.nginx.org/nginx/rev/78fc2dce69e7
branches:  
changeset: 6459:78fc2dce69e7
user:      Roman Arutyunyan <arut at nginx.com>
date:      Wed Mar 23 17:45:15 2016 +0300
description:
Stream: detect port absence in proxy_pass with IP literal.

This is a clone of http commit 26c127bab5ef.

diffstat:

 src/stream/ngx_stream_upstream.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 384154fc634f -r 78fc2dce69e7 src/stream/ngx_stream_upstream.c
--- a/src/stream/ngx_stream_upstream.c	Wed Mar 23 17:44:36 2016 +0300
+++ b/src/stream/ngx_stream_upstream.c	Wed Mar 23 17:45:15 2016 +0300
@@ -388,7 +388,7 @@ ngx_stream_upstream_add(ngx_conf_t *cf, 
     uscf->port = u->port;
     uscf->no_port = u->no_port;
 
-    if (u->naddrs == 1) {
+    if (u->naddrs == 1 && (u->port || u->family == AF_UNIX)) {
         uscf->servers = ngx_array_create(cf->pool, 1,
                                          sizeof(ngx_stream_upstream_server_t));
         if (uscf->servers == NULL) {



More information about the nginx-devel mailing list