diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2015-05-20 15:51:28 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2015-05-20 15:51:28 +0300 |
commit | d5c34785bc55164afb7cfe7de1badcebdb05fb8d (patch) | |
tree | ac8c4605212157ee2f5b09bc4c053d04bb569ede /src/mail/ngx_mail.c | |
parent | 68b3d28c55e8c24c9998a4292b40c4fbe4afc36f (diff) | |
download | nginx-d5c34785bc55164afb7cfe7de1badcebdb05fb8d.tar.gz nginx-d5c34785bc55164afb7cfe7de1badcebdb05fb8d.zip |
Simplified ngx_http_init_listening().
There is no need to set "i" to 0, as it's expected to be 0 assuming
the bindings are properly sorted, and we already rely on this when
explicitly set hport->naddrs to 1. Remaining conditional code is
replaced with identical "hport->naddrs = i + 1".
Identical modifications are done in the mail and stream modules,
in the ngx_mail_optimize_servers() and ngx_stream_optimize_servers()
functions, respectively.
No functional changes.
Diffstat (limited to 'src/mail/ngx_mail.c')
-rw-r--r-- | src/mail/ngx_mail.c | 8 |
1 files changed, 1 insertions, 7 deletions
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) |