From a58c6744588bee2dc7f808db4d2587cd08a6f26e Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 16 Nov 2009 00:00:00 +0300 Subject: [PATCH] nginx 0.8.26 *) Bugfix: in captures usage in "rewrite" directive; the bug had appeared in 0.8.25. *) Bugfix: nginx could not be built without the --with-debug option; the bug had appeared in 0.8.25. --- CHANGES | 9 +++++++++ CHANGES.ru | 13 +++++++++++-- src/core/nginx.h | 4 ++-- src/http/modules/perl/nginx.pm | 2 +- src/http/ngx_http_core_module.c | 4 ++++ src/http/ngx_http_script.c | 6 +++--- src/http/ngx_http_variables.c | 4 ++-- src/os/unix/ngx_alloc.c | 4 ++-- 8 files changed, 34 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index f92f0c6..f0ed864 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,13 @@ +Changes with nginx 0.8.26 16 Nov 2009 + + *) Bugfix: in captures usage in "rewrite" directive; the bug had + appeared in 0.8.25. + + *) Bugfix: nginx could not be built without the --with-debug option; + the bug had appeared in 0.8.25. + + Changes with nginx 0.8.25 16 Nov 2009 *) Change: now no message is written in an error log if a variable is diff --git a/CHANGES.ru b/CHANGES.ru index 1b6f8b6..dbdd4d0 100644 --- a/CHANGES.ru +++ b/CHANGES.ru @@ -1,4 +1,13 @@ +éÚÍÅÎÅÎÉÑ × nginx 0.8.26 16.11.2009 + + *) éÓÐÒÁ×ÌÅÎÉÅ: ÏÛÉÂËÉ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ×ÙÄÅÌÅÎÉÊ × ÄÉÒÅËÔÉ×Å rewrite; + ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.8.25. + + *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÓÏÂÉÒÁÌÓÑ ÂÅÚ ÐÁÒÁÍÅÔÒÁ --with-debug; ÏÛÉÂËÁ + ÐÏÑ×ÉÌÁÓØ × 0.8.25. + + éÚÍÅÎÅÎÉÑ × nginx 0.8.25 16.11.2009 *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ × ÌÏÇ ÏÛÉÂÏË ÎÅ ÐÉÛÅÔÓÑ ÓÏÏÂÝÅÎÉÅ, ÅÓÌÉ ÐÅÒÅÍÅÎÎÁÑ @@ -17,8 +26,8 @@ ÎÅÄÏÓÔÁÔËÅ ÐÁÍÑÔÉ; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.8.18. *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÐÅÒÅÄÁ×ÁÌ ÓÖÁÔÙÅ ÏÔ×ÅÔÙ ËÌÉÅÎÔÁÍ, ÎÅ - ÐÏÄÄÅÒÖÉ×ÁÀÝÉÍ ÓÖÁÔÉÅ ÐÒÉ ÎÁÓÔÒÏÊËÁÈ gzip_static on É gzip_vary off; - ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.8.16. + ÐÏÄÄÅÒÖÉ×ÁÀÝÉÍ ÓÖÁÔÉÅ, ÐÒÉ ÎÁÓÔÒÏÊËÁÈ gzip_static on É gzip_vary + off; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.8.16. éÚÍÅÎÅÎÉÑ × nginx 0.8.24 11.11.2009 diff --git a/src/core/nginx.h b/src/core/nginx.h index 3754422..95458ee 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,8 +8,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 8025 -#define NGINX_VERSION "0.8.25" +#define nginx_version 8026 +#define NGINX_VERSION "0.8.26" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm index c9e3cd2..f863ad4 100644 --- a/src/http/modules/perl/nginx.pm +++ b/src/http/modules/perl/nginx.pm @@ -47,7 +47,7 @@ our @EXPORT = qw( HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '0.8.25'; +our $VERSION = '0.8.26'; require XSLoader; XSLoader::load('nginx', $VERSION); diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 7ae49a6..e6b1162 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2759,6 +2759,10 @@ ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf) 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; } diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c index b809e2b..aa03df0 100644 --- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c @@ -910,14 +910,14 @@ ngx_http_script_regex_start_code(ngx_http_script_engine_t *e) e->buf.len = code->size; if (code->uri) { - if (rc && (r->quoted_uri || r->plus_in_uri)) { + if (r->ncaptures && (r->quoted_uri || r->plus_in_uri)) { e->buf.len += 2 * ngx_escape_uri(NULL, r->uri.data, r->uri.len, NGX_ESCAPE_ARGS); } } - for (n = 1; n < (ngx_uint_t) rc; n++) { - e->buf.len += r->captures[2 * n + 1] - r->captures[2 * n]; + for (n = 2; n < r->ncaptures; n += 2) { + e->buf.len += r->captures[n + 1] - r->captures[n]; } } else { diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index 633b310..a2852b0 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -1759,7 +1759,7 @@ ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, ngx_str_t *s) 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)); @@ -1810,7 +1810,7 @@ ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, ngx_str_t *s) #endif } - r->ncaptures = len; + r->ncaptures = rc * 2; r->captures_data = s->data; return NGX_OK; diff --git a/src/os/unix/ngx_alloc.c b/src/os/unix/ngx_alloc.c index 860666a..c71a102 100644 --- a/src/os/unix/ngx_alloc.c +++ b/src/os/unix/ngx_alloc.c @@ -61,7 +61,7 @@ ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) p = NULL; } - ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, + ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, "posix_memalign: %p:%uz @%uz", p, size, alignment); return p; @@ -80,7 +80,7 @@ ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) "memalign(%uz, %uz) failed", alignment, size); } - ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, + ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, "memalign: %p:%uz @%uz", p, size, alignment); return p; -- 2.11.4.GIT