Mercurial > hg > nginx
comparison src/http/ngx_http.c @ 603:858700ae46b4 release-0.3.23
nginx-0.3.23-RELEASE import
*) Feature: the "optimize_host_names" directive.
*) Bugfix: in using of the variables in the "path" and "alias"
directives.
*) Bugfix: the ngx_http_perl_module was incorrectly built on Linux and
Solaris.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 24 Jan 2006 16:08:27 +0000 |
parents | ebc68d8ca496 |
children | 608cf78b24ef |
comparison
equal
deleted
inserted
replaced
602:0d42d54505f2 | 603:858700ae46b4 |
---|---|
74 ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 74 ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
75 { | 75 { |
76 char *rv; | 76 char *rv; |
77 u_char ch; | 77 u_char ch; |
78 ngx_int_t rc; | 78 ngx_int_t rc; |
79 ngx_uint_t mi, m, s, l, p, a, n, i; | 79 ngx_uint_t mi, m, s, l, p, a, i; |
80 ngx_uint_t last, bind_all, done; | 80 ngx_uint_t last, bind_all, done; |
81 ngx_conf_t pcf; | 81 ngx_conf_t pcf; |
82 ngx_array_t in_ports; | 82 ngx_array_t in_ports; |
83 ngx_hash_init_t hash; | 83 ngx_hash_init_t hash; |
84 ngx_listening_t *ls; | 84 ngx_listening_t *ls; |
531 ngx_qsort(in_port[p].addrs.elts, (size_t) in_port[p].addrs.nelts, | 531 ngx_qsort(in_port[p].addrs.elts, (size_t) in_port[p].addrs.nelts, |
532 sizeof(ngx_http_conf_in_addr_t), ngx_http_cmp_conf_in_addrs); | 532 sizeof(ngx_http_conf_in_addr_t), ngx_http_cmp_conf_in_addrs); |
533 | 533 |
534 /* | 534 /* |
535 * check whether all name-based servers have the same configuraiton | 535 * check whether all name-based servers have the same configuraiton |
536 * as the default server, or some servers restrict the host names | 536 * as the default server, |
537 * or some servers restrict the host names, | |
538 * or some servers disable optimizing the host names | |
537 */ | 539 */ |
538 | 540 |
539 in_addr = in_port[p].addrs.elts; | 541 in_addr = in_port[p].addrs.elts; |
540 for (a = 0; a < in_port[p].addrs.nelts; a++) { | 542 for (a = 0; a < in_port[p].addrs.nelts; a++) { |
541 | 543 |
542 name = in_addr[a].names.elts; | 544 name = in_addr[a].names.elts; |
543 for (n = 0; n < in_addr[a].names.nelts; n++) { | 545 for (s = 0; s < in_addr[a].names.nelts; s++) { |
544 if (in_addr[a].core_srv_conf != name[n].core_srv_conf | 546 |
545 || name[n].core_srv_conf->restrict_host_names | 547 if (in_addr[a].core_srv_conf != name[s].core_srv_conf |
548 || name[s].core_srv_conf->optimize_host_names == 0 | |
549 || name[s].core_srv_conf->restrict_host_names | |
546 != NGX_HTTP_RESTRICT_HOST_OFF) | 550 != NGX_HTTP_RESTRICT_HOST_OFF) |
547 { | 551 { |
548 goto virtual_names; | 552 goto virtual_names; |
549 } | 553 } |
550 } | 554 } |
551 | 555 |
552 /* | 556 /* |
553 * if all name-based servers have the same configuration | 557 * if all name-based servers have the same configuration |
554 * as the default server, and no servers restrict the host names | 558 * as the default server, |
559 * and no servers restrict the host names, | |
560 * and no servers disable optimizing the host names | |
555 * then we do not need to check them at run-time at all | 561 * then we do not need to check them at run-time at all |
556 */ | 562 */ |
557 | 563 |
558 in_addr[a].names.nelts = 0; | 564 in_addr[a].names.nelts = 0; |
559 | 565 |