Mercurial > hg > nginx-ranges
diff src/http/ngx_http.c @ 463:a8424ffa495c NGINX_0_7_39
nginx 0.7.39
*) Bugfix: large response with SSI might hang, if gzipping was enabled;
the bug had appeared in 0.7.28.
Thanks to Artem Bokhan.
*) Bugfix: a segmentation fault might occur in worker process, if short
static variants are used in a "try_files" directive.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 02 Mar 2009 00:00:00 +0300 |
parents | 76a79816b771 |
children | bb941a2996a6 |
line wrap: on
line diff
--- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -1603,7 +1603,7 @@ ngx_http_cmp_dns_wildcards(const void *o 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, bind_wildcard = 0; } - a = 0; - - while (a < last) { - - if (bind_wildcard && !addr[a].bind) { - a++; + i = 0; + + while (i < last) { + + 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, 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_h 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_ 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;