comparison src/http/ngx_http_core_module.c @ 302:9b7db0df50f0 NGINX_0_5_21

nginx 0.5.21 *) Bugfix: if server has more than about ten locations, then regex locations might be choosen not in that order as they were specified. *) Bugfix: a worker process may got caught in an endless loop on 64-bit platform, if the 33-rd or next in succession backend has failed. Thanks to Anton Povarov. *) Bugfix: a bus error might occur on Solaris/sparc64 if the PCRE library was used. Thanks to Andrei Nigmatulin. *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 28 May 2007 00:00:00 +0400
parents cba14c1e2a4b
children 94e16de3c33f
comparison
equal deleted inserted replaced
301:a025840de07d 302:9b7db0df50f0
43 43
44 static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, 44 static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd,
45 void *dummy); 45 void *dummy);
46 static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, 46 static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd,
47 void *dummy); 47 void *dummy);
48 static int ngx_libc_cdecl ngx_http_core_cmp_locations(const void *first, 48 static int ngx_http_core_cmp_locations(const void *first, const void *second);
49 const void *second);
50 49
51 static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, 50 static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd,
52 void *conf); 51 void *conf);
53 static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, 52 static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy,
54 void *conf); 53 void *conf);
1640 1639
1641 if (rv != NGX_CONF_OK) { 1640 if (rv != NGX_CONF_OK) {
1642 return rv; 1641 return rv;
1643 } 1642 }
1644 1643
1645 ngx_qsort(cscf->locations.elts, (size_t) cscf->locations.nelts, 1644 ngx_sort(cscf->locations.elts, (size_t) cscf->locations.nelts,
1646 sizeof(ngx_http_core_loc_conf_t *), ngx_http_core_cmp_locations); 1645 sizeof(ngx_http_core_loc_conf_t *), ngx_http_core_cmp_locations);
1647 1646
1648 return rv; 1647 return rv;
1649 } 1648 }
1650 1649
1651 1650
1772 } 1771 }
1773 1772
1774 #if (NGX_PCRE) 1773 #if (NGX_PCRE)
1775 if (clcf->regex == NULL 1774 if (clcf->regex == NULL
1776 && ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len) 1775 && ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
1777 != 0) 1776 != 0)
1778 #else 1777 #else
1779 if (ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len) 1778 if (ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
1780 != 0) 1779 != 0)
1781 #endif 1780 #endif
1782 { 1781 {
1783 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1782 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1784 "location \"%V\" is outside location \"%V\"", 1783 "location \"%V\" is outside location \"%V\"",
1785 &clcf->name, &pclcf->name); 1784 &clcf->name, &pclcf->name);
1812 1811
1813 if (rv != NGX_CONF_OK) { 1812 if (rv != NGX_CONF_OK) {
1814 return rv; 1813 return rv;
1815 } 1814 }
1816 1815
1817 ngx_qsort(clcf->locations.elts, (size_t) clcf->locations.nelts, 1816 ngx_sort(clcf->locations.elts, (size_t) clcf->locations.nelts,
1818 sizeof(ngx_http_core_loc_conf_t *), ngx_http_core_cmp_locations); 1817 sizeof(ngx_http_core_loc_conf_t *), ngx_http_core_cmp_locations);
1819 1818
1820 return rv; 1819 return rv;
1821 } 1820 }
1822 1821
1823 1822
1824 static int ngx_libc_cdecl 1823 static int
1825 ngx_http_core_cmp_locations(const void *one, const void *two) 1824 ngx_http_core_cmp_locations(const void *one, const void *two)
1826 { 1825 {
1827 ngx_int_t rc; 1826 ngx_int_t rc;
1828 ngx_http_core_loc_conf_t *first, *second; 1827 ngx_http_core_loc_conf_t *first, *second;
1829 1828