changeset 242:ff906029dd40 NGINX_0_4_6

nginx 0.4.6 *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64, and ppc64. *) Bugfix: nginx sent the chunked response for HTTP/1.1 request, if its length was set by text string in the $r->headers_out("Content-Length", ...) method. *) Bugfix: after redirecting error by an "error_page" directive any ngx_http_rewrite_module directive returned this error code; bug appeared in 0.4.4.
author Igor Sysoev <http://sysoev.ru>
date Fri, 06 Oct 2006 00:00:00 +0400
parents c3cf292cce38
children d371c9d33781
files CHANGES CHANGES.ru auto/cc/gcc auto/cc/sunc auto/lib/perl/make auto/os/conf src/core/nginx.c src/core/nginx.h src/core/ngx_hash.c src/http/modules/ngx_http_rewrite_module.c src/http/modules/perl/nginx.xs src/http/ngx_http_variables.c
diffstat 12 files changed, 60 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,27 @@
 
+Changes with nginx 0.4.6                                         06 Oct 2006
+
+    *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64, 
+       and ppc64.
+
+    *) Bugfix: nginx sent the chunked response for HTTP/1.1 request,
+       if its length was set by text string in the 
+       $r->headers_out("Content-Length", ...) method.
+
+    *) Bugfix: after redirecting error by an "error_page" directive any 
+       ngx_http_rewrite_module directive returned this error code; bug 
+       appeared in 0.4.4.
+
+
+Changes with nginx 0.4.5                                         02 Oct 2006
+
+    *) Bugfix: nginx could not be built on Linux and Solaris; bug appeared 
+       in 0.4.4.
+
+
 Changes with nginx 0.4.4                                         02 Oct 2006
 
-    *) Feature: the "scheme" variable.
+    *) Feature: the $scheme variable.
 
     *) Feature: the "expires" directive supports the "max" parameter.
 
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,7 +1,27 @@
 
+Изменения в nginx 0.4.6                                           06.10.2006
+
+    *) Исправление: nginx не запускался на 64-битных платформах, отличной 
+       от amd64, sparc64 и ppc64.
+
+    *) Исправление: при запросе версии HTTP/1.1 nginx передавал ответ 
+       chunk'ами, если длина ответа в методе 
+       $r->headers_out("Content-Length", ...) была задана текстовой строкой.
+
+    *) Исправление: после перенаправления ошибки с помощью директивы 
+       error_page любая директива модуля ngx_http_rewrite_module возвращала 
+       эту ошибку; ошибка появилась в 0.4.4.
+
+
+Изменения в nginx 0.4.5                                           02.10.2006
+
+    *) Исправление: nginx не собирался на Linux и Solaris; ошибка появилась 
+       в 0.4.4.
+
+
 Изменения в nginx 0.4.4                                           02.10.2006
 
-    *) Добавление: переменная scheme.
+    *) Добавление: переменная $scheme.
 
     *) Добавление: директива expires поддерживает параметр max.
 
--- a/auto/cc/gcc
+++ b/auto/cc/gcc
@@ -36,7 +36,7 @@ fi
 
 case "$NGX_MACHINE" in
 
-    sun4u | sparc | sparc64 )
+    sun4u | sun4v | sparc | sparc64 )
         # "-mcpu=v9" enables the "casa" assembler instruction
         CFLAGS="$CFLAGS -mcpu=v9"
     ;;
--- a/auto/cc/sunc
+++ b/auto/cc/sunc
@@ -13,9 +13,9 @@ echo " + Sun C version: $NGX_SUNC_VER"
 have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
 
 
-case "$NGX_PLATFORM" in
+case "$NGX_MACHINE" in
 
-    *:i86pc)
+    i86pc)
         ngx_feature="PAUSE hardware capability bug"
         ngx_feature_name=
         ngx_feature_run=bug
@@ -33,7 +33,7 @@ case "$NGX_PLATFORM" in
         NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
     ;;
 
-    *:sun4u)
+    sun4u | sun4v)
         # "-xarch=v9" enables the "casa" assembler instruction
         CFLAGS="$CFLAGS -xarch=v9"
         CORE_LINK="$CORE_LINK -xarch=v9"
--- a/auto/lib/perl/make
+++ b/auto/lib/perl/make
@@ -14,6 +14,8 @@ cat << END                              
 
 	cd $NGX_OBJS/src/http/modules/perl && make
 
+	rm -rf $NGX_OBJS/install_perl
+
 
 $NGX_OBJS/src/http/modules/perl/Makefile:				\
 		src/http/modules/perl/Makefile.PL			\
@@ -30,5 +32,4 @@ cat << END                              
 		$NGX_PERL Makefile.PL					\
 			LIB=$NGX_PERL_MODULES
 
-
 END
--- a/auto/os/conf
+++ b/auto/os/conf
@@ -83,7 +83,7 @@ case "$NGX_MACHINE" in
         NGX_MACH_CACHE_LINE=64
     ;;
 
-    sun4u | sparc | sparc64)
+    sun4u | sun4v | sparc | sparc64)
         have=NGX_ALIGNMENT value=16 . auto/define
         # TODO
         NGX_MACH_CACHE_LINE=64
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -352,7 +352,8 @@ ngx_add_inherited_sockets(ngx_cycle_t *c
                   "using inherited sockets from \"%s\"", inherited);
 
     if (ngx_array_init(&cycle->listening, cycle->pool, 10,
-                                         sizeof(ngx_listening_t)) == NGX_ERROR)
+                       sizeof(ngx_listening_t))
+        == NGX_ERROR)
     {
         return NGX_ERROR;
     }
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VER          "nginx/0.4.5"
+#define NGINX_VER          "nginx/0.4.6"
 
 #define NGINX_VAR          "NGINX"
 #define NGX_OLDPID_EXT     ".oldbin"
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -166,7 +166,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ng
 
     bucket_size = hinit->bucket_size - sizeof(void *);
 
-    start = nelts / (bucket_size / (2 * sizeof(void *)) - 1);
+    start = nelts / (bucket_size / (2 * sizeof(void *)));
     start = start ? start : 1;
 
     if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) {
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -178,6 +178,10 @@ ngx_http_rewrite_handler(ngx_http_reques
         code(e);
     }
 
+    if (e->status == NGX_DECLINED) {
+        return NGX_DECLINED;
+    }
+
     if (r->err_status == 0) {
         return e->status;
     }
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -439,10 +439,9 @@ header_out(r, key, value)
 
     if (header->key.len == sizeof("Content-Length") - 1
         && ngx_strncasecmp(header->key.data, "Content-Length",
-                           sizeof("Content-Length") - 1) == 0
-        && SvIOK(value))
+                           sizeof("Content-Length") - 1) == 0)
     {
-        r->headers_out.content_length_n = (ssize_t) SvIV(value);;
+        r->headers_out.content_length_n = (off_t) SvIV(value);
         r->headers_out.content_length = header;
     }
 
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -640,7 +640,7 @@ ngx_http_variable_unknown_header(ngx_htt
             }
         }
 
-        if (n + prefix == var->len) {
+        if (n + prefix == var->len && n == header[i].key.len) {
             v->len = header[i].value.len;
             v->valid = 1;
             v->no_cachable = 0;