comparison src/http/ngx_http_core_module.c @ 2185:e9420c1b6f25

fix noregex for inclusive locations
author Igor Sysoev <igor@sysoev.ru>
date Sun, 17 Aug 2008 17:58:16 +0000
parents fb3b084e7d42
children ecce31d90117
comparison
equal deleted inserted replaced
2184:274c0f3ea600 2185:e9420c1b6f25
1120 static ngx_int_t 1120 static ngx_int_t
1121 ngx_http_core_find_location(ngx_http_request_t *r) 1121 ngx_http_core_find_location(ngx_http_request_t *r)
1122 { 1122 {
1123 ngx_int_t rc; 1123 ngx_int_t rc;
1124 ngx_http_core_loc_conf_t *pclcf; 1124 ngx_http_core_loc_conf_t *pclcf;
1125 #if (NGX_PCRE)
1126 ngx_int_t n;
1127 ngx_uint_t noregex;
1128 ngx_http_core_loc_conf_t *clcf, **clcfp;
1129
1130 noregex = 0;
1131 #endif
1125 1132
1126 pclcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 1133 pclcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1127 1134
1128 rc = ngx_http_core_find_static_location(r, pclcf->static_locations); 1135 rc = ngx_http_core_find_static_location(r, pclcf->static_locations);
1129 1136
1130 if (rc == NGX_AGAIN) { 1137 if (rc == NGX_AGAIN) {
1138
1139 #if (NGX_PCRE)
1140 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1141
1142 noregex = clcf->noregex;
1143 #endif
1144
1131 /* look up nested locations */ 1145 /* look up nested locations */
1146
1132 rc = ngx_http_core_find_location(r); 1147 rc = ngx_http_core_find_location(r);
1133 } 1148 }
1134 1149
1135 if (rc == NGX_OK || rc == NGX_DONE) { 1150 if (rc == NGX_OK || rc == NGX_DONE) {
1136 return rc; 1151 return rc;
1137 } 1152 }
1138 1153
1139 /* rc == NGX_DECLINED or rc == NGX_AGAIN in nested location */ 1154 /* rc == NGX_DECLINED or rc == NGX_AGAIN in nested location */
1140 1155
1141 #if (NGX_PCRE) 1156 #if (NGX_PCRE)
1142 { 1157
1143 ngx_int_t n; 1158 if (noregex == 0 && pclcf->regex_locations) {
1144 ngx_http_core_loc_conf_t *clcf, **clcfp;
1145
1146 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1147
1148 if (clcf->noregex == 0 && pclcf->regex_locations) {
1149 1159
1150 for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) { 1160 for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) {
1151 1161
1152 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1162 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1153 "test location: ~ \"%V\"", &(*clcfp)->name); 1163 "test location: ~ \"%V\"", &(*clcfp)->name);
1172 1182
1173 /* look up nested locations */ 1183 /* look up nested locations */
1174 1184
1175 return ngx_http_core_find_location(r); 1185 return ngx_http_core_find_location(r);
1176 } 1186 }
1177 }
1178 } 1187 }
1179 #endif 1188 #endif
1180 1189
1181 return rc; 1190 return rc;
1182 } 1191 }