aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-03-01 19:10:36 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-03-01 19:10:36 +0000
commit42c67dd5fba925f0fc3ef225c3c0386868a75b72 (patch)
tree6a42590fda231ec46de8369a71ed6e53aed2ab47 /src/http/ngx_http_core_module.c
parent288e503e92c9e8fd353e4fa829f29c8b0f467756 (diff)
downloadnginx-42c67dd5fba925f0fc3ef225c3c0386868a75b72.tar.gz
nginx-42c67dd5fba925f0fc3ef225c3c0386868a75b72.zip
fix case when the first try is shorter then URI
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 6a5daddb3..88672f088 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1086,12 +1086,8 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
len = tf->name.len;
}
- reserve = len - r->uri.len;
-
/* 16 bytes are preallocation */
- reserve = reserve < 16 ? 16 : reserve + 16;
-
- reserve += alias;
+ reserve = ngx_abs((ssize_t) (len - r->uri.len)) + alias + 16;
if (reserve > allocated) {