Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 2566:5e7d590cd704
fix case when regex locaiton runs the second time via internal redirect
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 14 Mar 2009 19:24:17 +0000 |
parents | 456e453eb84a |
children | 9c42c19f364a |
comparison
equal
deleted
inserted
replaced
2565:456e453eb84a | 2566:5e7d590cd704 |
---|---|
1376 for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) { | 1376 for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) { |
1377 | 1377 |
1378 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 1378 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1379 "test location: ~ \"%V\"", &(*clcfp)->name); | 1379 "test location: ~ \"%V\"", &(*clcfp)->name); |
1380 | 1380 |
1381 if ((*clcfp)->captures && r->captures == NULL) { | 1381 if ((*clcfp)->captures) { |
1382 | 1382 |
1383 len = (NGX_HTTP_MAX_CAPTURES + 1) * 3; | 1383 len = (NGX_HTTP_MAX_CAPTURES + 1) * 3; |
1384 | 1384 |
1385 r->captures = ngx_palloc(r->pool, len * sizeof(int)); | |
1386 if (r->captures == NULL) { | 1385 if (r->captures == NULL) { |
1387 return NGX_ERROR; | 1386 r->captures = ngx_palloc(r->pool, len * sizeof(int)); |
1387 if (r->captures == NULL) { | |
1388 return NGX_ERROR; | |
1389 } | |
1388 } | 1390 } |
1389 } | 1391 } |
1390 | 1392 |
1391 n = ngx_regex_exec((*clcfp)->regex, &r->uri, r->captures, len); | 1393 n = ngx_regex_exec((*clcfp)->regex, &r->uri, r->captures, len); |
1392 | 1394 |