changeset 374:67fa3851697b NGINX_0_6_31

nginx 0.6.31 *) Bugfix: nginx did not process FastCGI response if header was at the end of FastCGI record; bug appeared in 0.6.2. Thanks to Sergey Serov. *) Bugfix: a segmentation fault might occur in worker process if a file was deleted and the "open_file_cache_errors" directive was off.
author Igor Sysoev <http://sysoev.ru>
date Mon, 12 May 2008 00:00:00 +0400
parents 56370b6cb317
children 52f3c9c7eff0
files CHANGES CHANGES.ru src/core/nginx.h src/core/ngx_open_file_cache.c src/http/modules/ngx_http_fastcgi_module.c src/http/modules/perl/nginx.pm
diffstat 6 files changed, 43 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,14 @@
 
+Changes with nginx 0.6.31                                        12 May 2008
+
+    *) Bugfix: nginx did not process FastCGI response if header was at the 
+       end of FastCGI record; bug appeared in 0.6.2.
+       Thanks to Sergey Serov.
+
+    *) Bugfix: a segmentation fault might occur in worker process if a file 
+       was deleted and the "open_file_cache_errors" directive was off.
+
+
 Changes with nginx 0.6.30                                        29 Apr 2008
 
     *) Change: now if an "include" directive pattern does not match any 
@@ -7,7 +17,7 @@ Changes with nginx 0.6.30               
     *) Feature: now the time in directives may be specified without spaces, 
        for example, "1h50m".
 
-    *) Bugfix: memory leaks if the "ssl_verify_client" directive was on. 
+    *) Bugfix: memory leaks if the "ssl_verify_client" directive was on.
        Thanks to Chavelle Vincent.
 
     *) Bugfix: the "sub_filter" directive might set text to change into 
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,16 @@
 
+Изменения в nginx 0.6.31                                          12.05.2008
+
+    *) Исправление: nginx не обрабатывал ответ FastCGI-сервера, если строка 
+       заголовка ответ была в конце записи FastCGI; ошибка появилась в 
+       0.6.2.
+       Спасибо Сергею Серову.
+
+    *) Исправление: при удалении файла и использовании директивы 
+       open_file_cache_errors off в рабочем процессе мог произойти 
+       segmentation fault.
+
+
 Изменения в nginx 0.6.30                                          29.04.2008
 
     *) Изменение: теперь, если маске, заданной в директиве include, не 
@@ -8,7 +20,7 @@
        например, "1h50m".
 
     *) Исправление: утечек памяти, если директива ssl_verify_client имела 
-       значение on. 
+       значение on.
        Спасибо Chavelle Vincent.
 
     *) Исправление: директива sub_filter могла вставлять заменяемый текст в 
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VERSION      "0.6.30"
+#define NGINX_VERSION      "0.6.31"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -406,20 +406,27 @@ found:
 
 failed:
 
-    if (file && file->count == 0) {
+    if (file) {
         ngx_rbtree_delete(&cache->rbtree, &file->node);
 
         cache->current--;
 
-        if (file->fd != NGX_INVALID_FILE) {
-            if (ngx_close_file(file->fd) == NGX_FILE_ERROR) {
-                ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,
-                              ngx_close_file_n " \"%s\" failed", file->name);
-            }
+        if (file->count == 0) {
+
+	    if (file->fd != NGX_INVALID_FILE) {
+		if (ngx_close_file(file->fd) == NGX_FILE_ERROR) {
+		    ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,
+				  ngx_close_file_n " \"%s\" failed",
+                                  file->name);
+		}
+	    }
+
+            ngx_free(file->name);
+            ngx_free(file);
+
+        } else {
+            file->close = 1;
         }
-
-        ngx_free(file->name);
-        ngx_free(file);
     }
 
     if (of->fd != NGX_INVALID_FILE) {
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1232,7 +1232,7 @@ ngx_http_fastcgi_process_header(ngx_http
         }
 
         if (rc == NGX_OK) {
-            return NGX_AGAIN;
+            continue;
         }
 
         /* rc == NGX_AGAIN */
--- 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.6.30';
+our $VERSION = '0.6.31';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);