Mercurial > hg > nginx
changeset 3345:d8228f0b5113
evaluate maximum captures size on configuration phase
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 16 Nov 2009 19:11:38 +0000 |
parents | 1aed55182ea2 |
children | 06ce92293f6a |
files | src/http/ngx_http_core_module.c src/http/ngx_http_variables.c |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c Mon Nov 16 19:10:45 2009 +0000 +++ b/src/http/ngx_http_core_module.c Mon Nov 16 19:11:38 2009 +0000 @@ -2759,6 +2759,10 @@ cmcf->variables_hash_bucket_size = ngx_align(cmcf->variables_hash_bucket_size, ngx_cacheline_size); + if (cmcf->ncaptures) { + cmcf->ncaptures = (cmcf->ncaptures + 1) * 3; + } + return NGX_CONF_OK; }
--- a/src/http/ngx_http_variables.c Mon Nov 16 19:10:45 2009 +0000 +++ b/src/http/ngx_http_variables.c Mon Nov 16 19:11:38 2009 +0000 @@ -1759,7 +1759,7 @@ cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); if (re->ncaptures) { - len = (cmcf->ncaptures + 1) * 3; + len = cmcf->ncaptures; if (r->captures == NULL) { r->captures = ngx_palloc(r->pool, len * sizeof(int));