changeset 548:ab7d265273ed NGINX_0_8_26

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.
author Igor Sysoev <http://sysoev.ru>
date Mon, 16 Nov 2009 00:00:00 +0300
parents 43154840419e
children 04cfef16b736
files CHANGES CHANGES.ru src/core/nginx.h src/http/modules/perl/nginx.pm src/http/ngx_http_core_module.c src/http/ngx_http_script.c src/http/ngx_http_variables.c src/os/unix/ngx_alloc.c
diffstat 8 files changed, 34 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Mon Nov 16 00:00:00 2009 +0300
+++ b/CHANGES	Mon Nov 16 00:00:00 2009 +0300
@@ -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 
--- a/CHANGES.ru	Mon Nov 16 00:00:00 2009 +0300
+++ b/CHANGES.ru	Mon Nov 16 00:00:00 2009 +0300
@@ -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
--- a/src/core/nginx.h	Mon Nov 16 00:00:00 2009 +0300
+++ b/src/core/nginx.h	Mon Nov 16 00:00:00 2009 +0300
@@ -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"
--- a/src/http/modules/perl/nginx.pm	Mon Nov 16 00:00:00 2009 +0300
+++ b/src/http/modules/perl/nginx.pm	Mon Nov 16 00:00:00 2009 +0300
@@ -47,7 +47,7 @@
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.8.25';
+our $VERSION = '0.8.26';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http_core_module.c	Mon Nov 16 00:00:00 2009 +0300
+++ b/src/http/ngx_http_core_module.c	Mon Nov 16 00:00:00 2009 +0300
@@ -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_script.c	Mon Nov 16 00:00:00 2009 +0300
+++ b/src/http/ngx_http_script.c	Mon Nov 16 00:00:00 2009 +0300
@@ -910,14 +910,14 @@
         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 {
--- a/src/http/ngx_http_variables.c	Mon Nov 16 00:00:00 2009 +0300
+++ b/src/http/ngx_http_variables.c	Mon Nov 16 00:00:00 2009 +0300
@@ -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));
@@ -1810,7 +1810,7 @@
 #endif
     }
 
-    r->ncaptures = len;
+    r->ncaptures = rc * 2;
     r->captures_data = s->data;
 
     return NGX_OK;
--- a/src/os/unix/ngx_alloc.c	Mon Nov 16 00:00:00 2009 +0300
+++ b/src/os/unix/ngx_alloc.c	Mon Nov 16 00:00:00 2009 +0300
@@ -61,7 +61,7 @@
         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 @@
                       "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;