comparison src/http/ngx_http_core_module.c @ 2549:2d34fba7cf06

captures support in server_name
author Igor Sysoev <igor@sysoev.ru>
date Fri, 06 Mar 2009 12:50:20 +0000
parents 163114282d2c
children 8ec97ff12a0a
comparison
equal deleted inserted replaced
2548:163114282d2c 2549:2d34fba7cf06
2817 return NGX_CONF_ERROR; 2817 return NGX_CONF_ERROR;
2818 } 2818 }
2819 2819
2820 #if (NGX_PCRE) 2820 #if (NGX_PCRE)
2821 sn->regex = NULL; 2821 sn->regex = NULL;
2822 sn->captures = 0;
2822 #endif 2823 #endif
2823 sn->core_srv_conf = conf; 2824 sn->core_srv_conf = conf;
2824 sn->name.len = conf->server_name.len; 2825 sn->name.len = conf->server_name.len;
2825 sn->name.data = conf->server_name.data; 2826 sn->name.data = conf->server_name.data;
2826 } 2827 }
3418 return NGX_CONF_ERROR; 3419 return NGX_CONF_ERROR;
3419 } 3420 }
3420 3421
3421 #if (NGX_PCRE) 3422 #if (NGX_PCRE)
3422 sn->regex = NULL; 3423 sn->regex = NULL;
3424 sn->captures = 0;
3423 #endif 3425 #endif
3424 sn->core_srv_conf = cscf; 3426 sn->core_srv_conf = cscf;
3425 sn->name = value[i]; 3427 sn->name = value[i];
3426 3428
3427 if (value[i].data[0] != '~') { 3429 if (value[i].data[0] != '~') {
3444 if (sn->regex == NULL) { 3446 if (sn->regex == NULL) {
3445 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data); 3447 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data);
3446 return NGX_CONF_ERROR; 3448 return NGX_CONF_ERROR;
3447 } 3449 }
3448 3450
3451 sn->captures = (ngx_regex_capture_count(sn->regex) > 0);
3449 sn->name = value[i]; 3452 sn->name = value[i];
3450 } 3453 }
3451 #else 3454 #else
3452 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 3455 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3453 "the using of the regex \"%V\" " 3456 "the using of the regex \"%V\" "