Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2015-05-20 15:51:28 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2015-05-20 15:51:28 +0300
commitd5c34785bc55164afb7cfe7de1badcebdb05fb8d (patch)
treeac8c4605212157ee2f5b09bc4c053d04bb569ede /src/http/ngx_http.c
parent68b3d28c55e8c24c9998a4292b40c4fbe4afc36f (diff)
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/http/ngx_http.c')
-rw-r--r--src/http/ngx_http.c8
1 files changed, 1 insertions, 7 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) {