comparison src/http/ngx_http.c @ 1209:c6c33f81fd79

use stable search where it is required
author Igor Sysoev <igor@sysoev.ru>
date Mon, 21 May 2007 14:09:12 +0000
parents bae59a740c40
children 5e4d3b5d7ad0
comparison
equal deleted inserted replaced
1208:5eae5751507f 1209:c6c33f81fd79
17 static ngx_int_t ngx_http_add_names(ngx_conf_t *cf, 17 static ngx_int_t ngx_http_add_names(ngx_conf_t *cf,
18 ngx_http_conf_in_addr_t *in_addr, ngx_http_core_srv_conf_t *cscf); 18 ngx_http_conf_in_addr_t *in_addr, ngx_http_core_srv_conf_t *cscf);
19 static char *ngx_http_merge_locations(ngx_conf_t *cf, 19 static char *ngx_http_merge_locations(ngx_conf_t *cf,
20 ngx_array_t *locations, void **loc_conf, ngx_http_module_t *module, 20 ngx_array_t *locations, void **loc_conf, ngx_http_module_t *module,
21 ngx_uint_t ctx_index); 21 ngx_uint_t ctx_index);
22 static int ngx_libc_cdecl ngx_http_cmp_conf_in_addrs(const void *one, 22 static int ngx_http_cmp_conf_in_addrs(const void *one, const void *two);
23 const void *two);
24 static int ngx_libc_cdecl ngx_http_cmp_dns_wildcards(const void *one, 23 static int ngx_libc_cdecl ngx_http_cmp_dns_wildcards(const void *one,
25 const void *two); 24 const void *two);
26 25
27 ngx_uint_t ngx_http_max_module; 26 ngx_uint_t ngx_http_max_module;
28 27
597 /* AF_INET only */ 596 /* AF_INET only */
598 597
599 in_port = in_ports.elts; 598 in_port = in_ports.elts;
600 for (p = 0; p < in_ports.nelts; p++) { 599 for (p = 0; p < in_ports.nelts; p++) {
601 600
602 ngx_qsort(in_port[p].addrs.elts, (size_t) in_port[p].addrs.nelts, 601 ngx_sort(in_port[p].addrs.elts, (size_t) in_port[p].addrs.nelts,
603 sizeof(ngx_http_conf_in_addr_t), ngx_http_cmp_conf_in_addrs); 602 sizeof(ngx_http_conf_in_addr_t), ngx_http_cmp_conf_in_addrs);
604 603
605 /* 604 /*
606 * check whether all name-based servers have the same configuraiton 605 * check whether all name-based servers have the same configuraiton
607 * as the default server, 606 * as the default server,
608 * or some servers disable optimizing the server names 607 * or some servers disable optimizing the server names
1025 1024
1026 return NGX_CONF_OK; 1025 return NGX_CONF_OK;
1027 } 1026 }
1028 1027
1029 1028
1030 static int ngx_libc_cdecl 1029 static int
1031 ngx_http_cmp_conf_in_addrs(const void *one, const void *two) 1030 ngx_http_cmp_conf_in_addrs(const void *one, const void *two)
1032 { 1031 {
1033 ngx_http_conf_in_addr_t *first, *second; 1032 ngx_http_conf_in_addr_t *first, *second;
1034 1033
1035 first = (ngx_http_conf_in_addr_t *) one; 1034 first = (ngx_http_conf_in_addr_t *) one;