Mercurial > hg > nginx
changeset 2186:ecce31d90117
*) regex match must return NGX_OK to stop regex searching,
this fixes inclusive regex location
*) change NGX_HTTP_INTERNAL_SERVER_ERROR to NGX_ERROR
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 17 Aug 2008 18:02:55 +0000 |
parents | e9420c1b6f25 |
children | 8caf97ecb136 |
files | src/http/ngx_http_core_module.c |
diffstat | 1 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c Sun Aug 17 17:58:16 2008 +0000 +++ b/src/http/ngx_http_core_module.c Sun Aug 17 18:02:55 2008 +0000 @@ -789,7 +789,7 @@ rc = ngx_http_core_find_location(r); - if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) { + if (rc == NGX_ERROR) { ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return NGX_OK; } @@ -1117,6 +1117,14 @@ } +/* + * NGX_OK - exact or regex match + * NGX_DONE - auto redirect + * NGX_AGAIN - inclusive match + * NGX_ERROR - regex error + * NGX_DECLINED - no match + */ + static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r) { @@ -1173,7 +1181,7 @@ ngx_regex_exec_n " failed: %d on \"%V\" using \"%V\"", n, &r->uri, &(*clcfp)->name); - return NGX_HTTP_INTERNAL_SERVER_ERROR; + return NGX_ERROR; } /* match */ @@ -1182,7 +1190,9 @@ /* look up nested locations */ - return ngx_http_core_find_location(r); + rc = ngx_http_core_find_location(r); + + return (rc == NGX_ERROR) ? rc : NGX_OK; } } #endif