aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http.c8
-rw-r--r--src/mail/ngx_mail.c8
-rw-r--r--src/stream/ngx_stream.c8
3 files changed, 3 insertions, 21 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 924c4b548..adb4b6f36 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1719,13 +1719,7 @@ ngx_http_init_listening(ngx_conf_t *cf, ngx_http_conf_port_t *port)
ls->servers = hport;
- if (i == last - 1) {
- hport->naddrs = last;
-
- } else {
- hport->naddrs = 1;
- i = 0;
- }
+ hport->naddrs = i + 1;
switch (ls->sockaddr->sa_family) {
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c
index 48ce28617..f10f08c5f 100644
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -392,13 +392,7 @@ ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->servers = mport;
- if (i == last - 1) {
- mport->naddrs = last;
-
- } else {
- mport->naddrs = 1;
- i = 0;
- }
+ mport->naddrs = i + 1;
switch (ls->sockaddr->sa_family) {
#if (NGX_HAVE_INET6)
diff --git a/src/stream/ngx_stream.c b/src/stream/ngx_stream.c
index e5ffcf9bc..18aea28af 100644
--- a/src/stream/ngx_stream.c
+++ b/src/stream/ngx_stream.c
@@ -393,13 +393,7 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->servers = stport;
- if (i == last - 1) {
- stport->naddrs = last;
-
- } else {
- stport->naddrs = 1;
- i = 0;
- }
+ stport->naddrs = i + 1;
switch (ls->sockaddr->sa_family) {
#if (NGX_HAVE_INET6)