X-Git-Url: http://git.rot13.org/?p=nginx.git;a=blobdiff_plain;f=nginx%2Fsrc%2Fhttp%2Fngx_http.c;h=626686ca8246306cbfadb510826672f5f0f58b12;hp=ecd9c97d7b680da925ba1badabe4108bbdd1b182;hb=edef48fd7f4269957bc636301b0ffc73a16f9a4a;hpb=ce73043f2886947385224e3e77da24a2bb1643b1 diff --git a/nginx/src/http/ngx_http.c b/nginx/src/http/ngx_http.c index ecd9c97..626686c 100644 --- a/nginx/src/http/ngx_http.c +++ b/nginx/src/http/ngx_http.c @@ -1603,7 +1603,7 @@ ngx_http_cmp_dns_wildcards(const void *one, const void *two) static ngx_int_t ngx_http_init_listening(ngx_conf_t *cf, ngx_http_conf_port_t *port) { - ngx_uint_t i, a, last, bind_wildcard; + ngx_uint_t i, last, bind_wildcard; ngx_listening_t *ls; ngx_http_port_t *hport; ngx_http_conf_addr_t *addr; @@ -1626,16 +1626,16 @@ ngx_http_init_listening(ngx_conf_t *cf, ngx_http_conf_port_t *port) bind_wildcard = 0; } - a = 0; + i = 0; - while (a < last) { + while (i < last) { - if (bind_wildcard && !addr[a].bind) { - a++; + if (bind_wildcard && !addr[i].bind) { + i++; continue; } - ls = ngx_http_add_listening(cf, &addr[a]); + ls = ngx_http_add_listening(cf, &addr[i]); if (ls == NULL) { return NGX_ERROR; } @@ -1647,23 +1647,12 @@ ngx_http_init_listening(ngx_conf_t *cf, ngx_http_conf_port_t *port) ls->servers = hport; - hport->port = ntohs(port->port); - - for (i = ls->addr_text.len - 1; i; i--) { - - if (ls->addr_text.data[i] == ':') { - hport->port_text.len = ls->addr_text.len - i; - hport->port_text.data = &ls->addr_text.data[i]; - break; - } - } - - if (a == last - 1) { + if (i == last - 1) { hport->naddrs = last; } else { hport->naddrs = 1; - a = 0; + i = 0; } switch (ls->sockaddr->sa_family) { @@ -1823,7 +1812,7 @@ ngx_http_add_addrs(ngx_conf_t *cf, ngx_http_port_t *hport, return NGX_ERROR; } - addrs[i].conf.virtual_names = vn; + addrs[i].conf.core_srv_conf->virtual_names = vn; vn->names.hash = addr[i].hash; vn->names.wc_head = addr[i].wc_head; @@ -1880,7 +1869,7 @@ ngx_http_add_addrs6(ngx_conf_t *cf, ngx_http_port_t *hport, return NGX_ERROR; } - addrs6[i].conf.virtual_names = vn; + addrs6[i].conf.core_srv_conf->virtual_names = vn; vn->names.hash = addr[i].hash; vn->names.wc_head = addr[i].wc_head;