comparison src/http/ngx_http_core_module.c @ 554:5c576ea5dbd9 NGINX_0_8_29

nginx 0.8.29 *) Change: now the "009" status code is written to an access log for proxied HTTP/0.9 responses. *) Feature: the "addition_types", "charset_types", "gzip_types", "ssi_types", "sub_filter_types", and "xslt_types" directives support an "*" parameter. *) Feature: GCC 4.1+ built-in atomic operations usage. Thanks to W-Mark Kubacki. *) Feature: the --with-libatomic[=DIR] option in the configure. Thanks to W-Mark Kubacki. *) Bugfix: listen unix domain socket had limited access rights. *) Bugfix: cached HTTP/0.9 responses were handled incorrectly. *) Bugfix: regular expression named captures given by "?P<...>" did not work in a "server_name" directive. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Nov 2009 00:00:00 +0300
parents ab7d265273ed
children 25255878df91
comparison
equal deleted inserted replaced
553:63dde5a94756 554:5c576ea5dbd9
1569 ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash) 1569 ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash)
1570 { 1570 {
1571 u_char c, *lowcase; 1571 u_char c, *lowcase;
1572 size_t len; 1572 size_t len;
1573 ngx_uint_t i, hash; 1573 ngx_uint_t i, hash;
1574
1575 if (types_hash->size == 0) {
1576 return (void *) 4;
1577 }
1574 1578
1575 if (r->headers_out.content_type.len == 0) { 1579 if (r->headers_out.content_type.len == 0) {
1576 return NULL; 1580 return NULL;
1577 } 1581 }
1578 1582
3505 sn->regex = NULL; 3509 sn->regex = NULL;
3506 #endif 3510 #endif
3507 sn->server = cscf; 3511 sn->server = cscf;
3508 sn->name = value[i]; 3512 sn->name = value[i];
3509 3513
3510 ngx_strlow(sn->name.data, sn->name.data, sn->name.len);
3511
3512 if (value[i].data[0] != '~') { 3514 if (value[i].data[0] != '~') {
3515 ngx_strlow(sn->name.data, sn->name.data, sn->name.len);
3513 continue; 3516 continue;
3514 } 3517 }
3515 3518
3516 #if (NGX_PCRE) 3519 #if (NGX_PCRE)
3517 { 3520 {
3518 ngx_regex_compile_t rc; 3521 u_char *p;
3519 u_char errstr[NGX_MAX_CONF_ERRSTR]; 3522 ngx_regex_compile_t rc;
3523 u_char errstr[NGX_MAX_CONF_ERRSTR];
3520 3524
3521 if (value[i].len == 1) { 3525 if (value[i].len == 1) {
3522 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 3526 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3523 "empty regex in server name \"%V\"", &value[i]); 3527 "empty regex in server name \"%V\"", &value[i]);
3524 return NGX_CONF_ERROR; 3528 return NGX_CONF_ERROR;
3530 ngx_memzero(&rc, sizeof(ngx_regex_compile_t)); 3534 ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
3531 3535
3532 rc.pattern = value[i]; 3536 rc.pattern = value[i];
3533 rc.err.len = NGX_MAX_CONF_ERRSTR; 3537 rc.err.len = NGX_MAX_CONF_ERRSTR;
3534 rc.err.data = errstr; 3538 rc.err.data = errstr;
3539
3540 for (p = value[i].data; p < value[i].data + value[i].len; p++) {
3541 if (*p >= 'A' && *p <= 'Z') {
3542 rc.options = NGX_REGEX_CASELESS;
3543 break;
3544 }
3545 }
3535 3546
3536 sn->regex = ngx_http_regex_compile(cf, &rc); 3547 sn->regex = ngx_http_regex_compile(cf, &rc);
3537 if (sn->regex == NULL) { 3548 if (sn->regex == NULL) {
3538 return NGX_CONF_ERROR; 3549 return NGX_CONF_ERROR;
3539 } 3550 }