comparison src/http/ngx_http.c @ 478:f2c6a7373274 NGINX_0_7_51

nginx 0.7.51 *) Feature: the "try_files" directive supports a response code in the fallback parameter. *) Feature: now any response code can be used in the "return" directive. *) Bugfix: the "error_page" directive made an external redirect without query string; the bug had appeared in 0.7.44. *) Bugfix: if servers listened on several defined explicitly addresses, then virtual servers might not work; the bug had appeared in 0.7.39.
author Igor Sysoev <http://sysoev.ru>
date Sun, 12 Apr 2009 00:00:00 +0400
parents c8cfb6c462ef
children ed5e10fb40fc
comparison
equal deleted inserted replaced
477:ba2ea8c4d60f 478:f2c6a7373274
1371 1371
1372 static ngx_int_t 1372 static ngx_int_t
1373 ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf, 1373 ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
1374 ngx_array_t *ports) 1374 ngx_array_t *ports)
1375 { 1375 {
1376 ngx_uint_t s, p, a; 1376 ngx_uint_t s, p, a;
1377 ngx_http_conf_port_t *port; 1377 ngx_http_conf_port_t *port;
1378 ngx_http_conf_addr_t *addr; 1378 ngx_http_conf_addr_t *addr;
1379 ngx_http_server_name_t *name; 1379 ngx_http_server_name_t *name;
1380 1380
1381 port = ports->elts; 1381 port = ports->elts;
1382 for (p = 0; p < ports->nelts; p++) { 1382 for (p = 0; p < ports->nelts; p++) {
1383 1383
1384 ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts, 1384 ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts,
1423 1423
1424 static ngx_int_t 1424 static ngx_int_t
1425 ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf, 1425 ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
1426 ngx_http_conf_addr_t *addr) 1426 ngx_http_conf_addr_t *addr)
1427 { 1427 {
1428 ngx_int_t rc; 1428 ngx_int_t rc;
1429 ngx_uint_t s; 1429 ngx_uint_t s;
1430 ngx_hash_init_t hash; 1430 ngx_hash_init_t hash;
1431 ngx_http_server_name_t *name; 1431 ngx_hash_keys_arrays_t ha;
1432 ngx_hash_keys_arrays_t ha; 1432 ngx_http_server_name_t *name;
1433 #if (NGX_PCRE) 1433 #if (NGX_PCRE)
1434 ngx_uint_t regex, i; 1434 ngx_uint_t regex, i;
1435 1435
1436 regex = 0; 1436 regex = 0;
1437 #endif 1437 #endif
1438 1438
1439 ngx_memzero(&ha, sizeof(ngx_hash_keys_arrays_t)); 1439 ngx_memzero(&ha, sizeof(ngx_hash_keys_arrays_t));
1823 vn = ngx_palloc(cf->pool, sizeof(ngx_http_virtual_names_t)); 1823 vn = ngx_palloc(cf->pool, sizeof(ngx_http_virtual_names_t));
1824 if (vn == NULL) { 1824 if (vn == NULL) {
1825 return NGX_ERROR; 1825 return NGX_ERROR;
1826 } 1826 }
1827 1827
1828 addrs[i].conf.core_srv_conf->virtual_names = vn; 1828 addrs[i].conf.virtual_names = vn;
1829 1829
1830 vn->names.hash = addr[i].hash; 1830 vn->names.hash = addr[i].hash;
1831 vn->names.wc_head = addr[i].wc_head; 1831 vn->names.wc_head = addr[i].wc_head;
1832 vn->names.wc_tail = addr[i].wc_tail; 1832 vn->names.wc_tail = addr[i].wc_tail;
1833 #if (NGX_PCRE) 1833 #if (NGX_PCRE)
1880 vn = ngx_palloc(cf->pool, sizeof(ngx_http_virtual_names_t)); 1880 vn = ngx_palloc(cf->pool, sizeof(ngx_http_virtual_names_t));
1881 if (vn == NULL) { 1881 if (vn == NULL) {
1882 return NGX_ERROR; 1882 return NGX_ERROR;
1883 } 1883 }
1884 1884
1885 addrs6[i].conf.core_srv_conf->virtual_names = vn; 1885 addrs6[i].conf.virtual_names = vn;
1886 1886
1887 vn->names.hash = addr[i].hash; 1887 vn->names.hash = addr[i].hash;
1888 vn->names.wc_head = addr[i].wc_head; 1888 vn->names.wc_head = addr[i].wc_head;
1889 vn->names.wc_tail = addr[i].wc_tail; 1889 vn->names.wc_tail = addr[i].wc_tail;
1890 #if (NGX_PCRE) 1890 #if (NGX_PCRE)