comparison src/http/ngx_http_core_module.c @ 400:69e851f83522

nginx-0.0.8-2004-07-26-20:21:18 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 26 Jul 2004 16:21:18 +0000
parents 6f3b20c1ac50
children b32ca005e025
comparison
equal deleted inserted replaced
399:4e21d1291a14 400:69e851f83522
587 /* the locations are lexicographically sorted */ 587 /* the locations are lexicographically sorted */
588 break; 588 break;
589 } 589 }
590 590
591 if (n == 0) { 591 if (n == 0) {
592 if (clcfp[i]->exact_match && r->uri.len == clcfp[i]->name.len) {
593 r->loc_conf = clcfp[i]->loc_conf;
594 return NGX_HTTP_LOCATION_EXACT;
595 }
596
592 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 597 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
593 598
594 if (clcf->name.len >= clcfp[i]->name.len) { 599 #if 0
600 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
601 "p:%d c:%d", clcf->name.len, clcfp[i]->name.len);
602 #endif
603
604 if (clcf->name.len > clcfp[i]->name.len) {
595 /* the previous match is longer */ 605 /* the previous match is longer */
596 break; 606 break;
597 } 607 }
598 608
599 r->loc_conf = clcfp[i]->loc_conf; 609 r->loc_conf = clcfp[i]->loc_conf;
600
601 if (clcfp[i]->exact_match && r->uri.len == clcfp[i]->name.len) {
602 return NGX_HTTP_LOCATION_EXACT;
603 }
604
605 found = 1; 610 found = 1;
606 } 611 }
607 } 612 }
608 613
609 if (found) { 614 if (found) {
1108 "the exact location \"%s\"", 1113 "the exact location \"%s\"",
1109 clcf->name.data, pclcf->name.data); 1114 clcf->name.data, pclcf->name.data);
1110 return NGX_CONF_ERROR; 1115 return NGX_CONF_ERROR;
1111 } 1116 }
1112 1117
1118 #if (HAVE_PCRE)
1113 if (clcf->regex == NULL 1119 if (clcf->regex == NULL
1114 && ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len) 1120 && ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
1115 != 0) 1121 != 0)
1122 #else
1123 if (ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
1124 != 0)
1125 #endif
1116 { 1126 {
1117 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1127 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1118 "location \"%s\" is outside location \"%s\"", 1128 "location \"%s\" is outside location \"%s\"",
1119 clcf->name.data, pclcf->name.data); 1129 clcf->name.data, pclcf->name.data);
1120 return NGX_CONF_ERROR; 1130 return NGX_CONF_ERROR;