changeset 499:e66f886a8305 NGINX_0_7_57

nginx 0.7.57 *) Bugfix: a segmentation fault occurred in worker process, if the ngx_http_image_filter_module errors were redirected to named location; the bug had appeared in 0.7.56.
author Igor Sysoev <http://sysoev.ru>
date Tue, 12 May 2009 00:00:00 +0400
parents c91fb8e75a55
children bb2281a3edb6
files CHANGES CHANGES.ru auto/lib/md5/make auto/lib/openssl/make auto/lib/pcre/make auto/lib/pcre/makefile.bcc auto/lib/pcre/makefile.msvc auto/lib/sha1/make auto/lib/zlib/make auto/make src/core/nginx.h src/http/modules/ngx_http_image_filter_module.c src/http/modules/perl/nginx.pm
diffstat 13 files changed, 34 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,11 @@
 
+Changes with nginx 0.7.57                                        12 May 2009
+
+    *) Bugfix: a segmentation fault occurred in worker process, if the 
+       ngx_http_image_filter_module errors were redirected to named 
+       location; the bug had appeared in 0.7.56.
+
+
 Changes with nginx 0.7.56                                        11 May 2009
 
     *) Feature: nginx/Windows supports IPv6 in a "listen" directive of the 
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,11 @@
 
+Изменения в nginx 0.7.57                                          12.05.2009
+
+    *) Исправление: при перенаправлении ошибок модуля 
+       ngx_http_image_filter_module в именованный location в рабочем 
+       процессе происходил floating-point fault; ошибка появилась в 0.7.56.
+
+
 Изменения в nginx 0.7.56                                          11.05.2009
 
     *) Добавление: nginx/Windows поддерживает IPv6 в директиве listen 
--- a/auto/lib/md5/make
+++ b/auto/lib/md5/make
@@ -35,7 +35,7 @@ case "$NGX_PLATFORM" in
 `echo "$MD5/md5.lib:	$NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
 	cd `echo $MD5 | sed -e "s/\//$ngx_regex_dirsep/g"`
 	\$(MAKE) -f $ngx_makefile $ngx_opt
-	cd ..\\..\\..
+	cd \$(CURDIR)
 
 END
 
--- a/auto/lib/openssl/make
+++ b/auto/lib/openssl/make
@@ -22,7 +22,7 @@ case "$CC" in
 	perl Configure VC-WIN32 no-shared
 	ms\\do_ms
 	\$(MAKE) -f ms\\nt.mak
-	cd ..\\..\\..
+	cd \$(CURDIR)
 
 END
 
@@ -39,7 +39,7 @@ END
 	perl Configure BC-32 no-shared
 	ms\\do_nasm
 	\$(MAKE) -f ms\\bcb.mak
-	cd ..\\..\\..
+	cd \$(CURDIR)
 
 END
 
--- a/auto/lib/pcre/make
+++ b/auto/lib/pcre/make
@@ -38,13 +38,12 @@ case "$NGX_PLATFORM" in
 `echo "$PCRE/pcre.h:	$NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
 	cd $ngx_pcre
 	\$(MAKE) -f $ngx_makefile pcre.h
-	cd ..\\..\\..
-
+	cd \$(CURDIR)
 
 `echo "$PCRE/pcre.lib:	$PCRE/pcre.h" | sed -e "s/\//$ngx_regex_dirsep/g"`
 	cd $ngx_pcre
 	\$(MAKE) -f $ngx_makefile $ngx_opt
-	cd ..\\..\\..
+	cd \$(CURDIR)
 
 END
 
--- a/auto/lib/pcre/makefile.bcc
+++ b/auto/lib/pcre/makefile.bcc
@@ -18,4 +18,4 @@ pcre.lib:	pcre.h
 pcre.h:
 	patch -o pcre.h pcre.in patch.pcre.in
 	patch -o config.h config.in patch.config.in
-	patch -o pcre.c pcre.c patch.pcre.c
+	patch < patch.pcre.c
--- a/auto/lib/pcre/makefile.msvc
+++ b/auto/lib/pcre/makefile.msvc
@@ -20,4 +20,4 @@ pcre.lib:	pcre.h
 pcre.h:
 	patch -o pcre.h pcre.in patch.pcre.in
 	patch -o config.h config.in patch.config.in
-	patch -o pcre.c pcre.c patch.pcre.c
+	patch < patch.pcre.c
--- a/auto/lib/sha1/make
+++ b/auto/lib/sha1/make
@@ -35,7 +35,7 @@ case "$NGX_PLATFORM" in
 `echo "$SHA1/sha1.lib:	$NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
 	cd `echo $SHA1 | sed -e "s/\//$ngx_regex_dirsep/g"`
 	\$(MAKE) -f $ngx_makefile $ngx_opt
-	cd ..\\..\\..
+	cd \$(CURDIR)
 
 END
 
--- a/auto/lib/zlib/make
+++ b/auto/lib/zlib/make
@@ -36,7 +36,7 @@ case "$NGX_PLATFORM" in
 `echo "$ZLIB/zlib.lib:	$NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
 	cd `echo $ZLIB | sed -e "s/\//$ngx_regex_dirsep/g"`
 	\$(MAKE) -f $ngx_makefile $ngx_opt
-	cd ..\\..\\..
+	cd \$(CURDIR)
 
 END
 
--- a/auto/make
+++ b/auto/make
@@ -22,6 +22,7 @@ CC =	$CC
 CFLAGS = $CFLAGS
 CPP =	$CPP
 LINK =	$LINK
+CURDIR = `pwd`
 
 END
 
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define nginx_version         7056
-#define NGINX_VERSION      "0.7.56"
+#define nginx_version         7057
+#define NGINX_VERSION      "0.7.57"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/http/modules/ngx_http_image_filter_module.c
+++ b/src/http/modules/ngx_http_image_filter_module.c
@@ -162,6 +162,13 @@ ngx_http_image_header_filter(ngx_http_re
         return ngx_http_next_header_filter(r);
     }
 
+    ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
+
+    if (ctx) {
+        ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module);
+        return ngx_http_next_header_filter(r);
+    }
+
     conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
 
     if (conf->filter == NGX_HTTP_IMAGE_OFF) {
@@ -181,13 +188,6 @@ ngx_http_image_header_filter(ngx_http_re
         return NGX_ERROR;
     }
 
-    ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
-
-    if (ctx) {
-        ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module);
-        return ngx_http_next_header_filter(r);
-    }
-
     ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_image_filter_ctx_t));
     if (ctx == NULL) {
         return NGX_ERROR;
--- 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.7.56';
+our $VERSION = '0.7.57';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);