comparison src/http/ngx_http_core_module.c @ 3749:3ee39f593642

if a location is specified by regex, then always compile an "alias", even into one static string script: this elimates testing this too specific case inside ngx_http_map_uri_to_path()
author Igor Sysoev <igor@sysoev.ru>
date Thu, 26 Aug 2010 12:33:08 +0000
parents 72cc5b789021
children 6cde13492433
comparison
equal deleted inserted replaced
3748:85224d3b3f93 3749:3ee39f593642
3786 } 3786 }
3787 3787
3788 n = ngx_http_script_variables_count(&clcf->root); 3788 n = ngx_http_script_variables_count(&clcf->root);
3789 3789
3790 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); 3790 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
3791 sc.variables = n;
3792
3793 #if (NGX_PCRE)
3794 if (alias && clcf->regex) {
3795 n = 1;
3796 }
3797 #endif
3791 3798
3792 if (n) { 3799 if (n) {
3793 sc.cf = cf; 3800 sc.cf = cf;
3794 sc.source = &clcf->root; 3801 sc.source = &clcf->root;
3795 sc.lengths = &clcf->root_lengths; 3802 sc.lengths = &clcf->root_lengths;
3796 sc.values = &clcf->root_values; 3803 sc.values = &clcf->root_values;
3797 sc.variables = n;
3798 sc.complete_lengths = 1; 3804 sc.complete_lengths = 1;
3799 sc.complete_values = 1; 3805 sc.complete_values = 1;
3800 3806
3801 if (ngx_http_script_compile(&sc) != NGX_OK) { 3807 if (ngx_http_script_compile(&sc) != NGX_OK) {
3802 return NGX_CONF_ERROR; 3808 return NGX_CONF_ERROR;