From: Igor Sysoev Date: Sun, 1 Mar 2009 19:10:36 +0000 (+0000) Subject: fix case when the first try is shorter then URI X-Git-Tag: release-0.7.39~2 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=42c67dd5fba925f0fc3ef225c3c0386868a75b72;p=nginx.git fix case when the first try is shorter then URI --- 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) {