changeset 512:6557aef8a4b2 NGINX_0_8_8

nginx 0.8.8 *) Bugfix: in handling FastCGI headers split in records. *) Bugfix: a segmentation fault occurred in worker process, if a request was handled in two proxied or FastCGIed locations and a caching was enabled in the first location; the bug had appeared in 0.8.7.
author Igor Sysoev <http://sysoev.ru>
date Mon, 10 Aug 2009 00:00:00 +0400
parents e8f9a06185f3
children 16d97d9e72b7
files CHANGES CHANGES.ru src/core/nginx.h src/http/modules/ngx_http_fastcgi_module.c src/http/modules/perl/nginx.pm src/http/ngx_http_upstream.c
diffstat 6 files changed, 32 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Mon Jul 27 00:00:00 2009 +0400
+++ b/CHANGES	Mon Aug 10 00:00:00 2009 +0400
@@ -1,4 +1,14 @@
 
+Changes with nginx 0.8.8                                         10 Aug 2009
+
+    *) Bugfix: in handling FastCGI headers split in records.
+
+    *) Bugfix: a segmentation fault occurred in worker process, if a 
+       request was handled in two proxied or FastCGIed locations and a 
+       caching was enabled in the first location; the bug had appeared in 
+       0.8.7.
+
+
 Changes with nginx 0.8.7                                         27 Jul 2009
 
     *) Change: minimum supported OpenSSL version is 0.9.7.
--- a/CHANGES.ru	Mon Jul 27 00:00:00 2009 +0400
+++ b/CHANGES.ru	Mon Aug 10 00:00:00 2009 +0400
@@ -1,4 +1,15 @@
 
+Изменения в nginx 0.8.8                                           10.08.2009
+
+    *) Исправление: в обработке заголовков ответа, разделённых в 
+       FastCGI-записях.
+
+    *) Исправление: если запрос обрабатывался в двух проксированных или 
+       FastCGI location'ах и в первом из них использовалось кэширование, то 
+       в рабочем процессе происходил segmentation fault; ошибка появилась в 
+       0.8.7.
+
+
 Изменения в nginx 0.8.7                                           27.07.2009
 
     *) Изменение: минимальная поддерживаемая версия OpenSSL - 0.9.7.
--- a/src/core/nginx.h	Mon Jul 27 00:00:00 2009 +0400
+++ b/src/core/nginx.h	Mon Aug 10 00:00:00 2009 +0400
@@ -8,8 +8,8 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define nginx_version         8007
-#define NGINX_VERSION      "0.8.7"
+#define nginx_version         8008
+#define NGINX_VERSION      "0.8.8"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/http/modules/ngx_http_fastcgi_module.c	Mon Jul 27 00:00:00 2009 +0400
+++ b/src/http/modules/ngx_http_fastcgi_module.c	Mon Aug 10 00:00:00 2009 +0400
@@ -1065,7 +1065,7 @@
 static ngx_int_t
 ngx_http_fastcgi_process_header(ngx_http_request_t *r)
 {
-    u_char                         *p, *start, *last, *part_start;
+    u_char                         *p, *start, *last, *part_start, *part_end;
     size_t                          size;
     ngx_str_t                      *status_line, line, *pattern;
     ngx_int_t                       rc, status;
@@ -1237,6 +1237,7 @@
         for ( ;; ) {
 
             part_start = u->buffer.pos;
+            part_end = u->buffer.last;
 
             rc = ngx_http_parse_header_line(r, &u->buffer, 1);
 
@@ -1437,7 +1438,11 @@
         part = ngx_array_push(f->split_parts);
 
         part->start = part_start;
-        part->end = u->buffer.last;
+        part->end = part_end;
+
+        if (u->buffer.pos < u->buffer.last) {
+            continue;
+        }
 
         return NGX_AGAIN;
     }
--- a/src/http/modules/perl/nginx.pm	Mon Jul 27 00:00:00 2009 +0400
+++ b/src/http/modules/perl/nginx.pm	Mon Aug 10 00:00:00 2009 +0400
@@ -47,7 +47,7 @@
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.8.7';
+our $VERSION = '0.8.8';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http_upstream.c	Mon Jul 27 00:00:00 2009 +0400
+++ b/src/http/ngx_http_upstream.c	Mon Aug 10 00:00:00 2009 +0400
@@ -2883,7 +2883,7 @@
 
 #if (NGX_HTTP_CACHE)
 
-    if (u->cacheable) {
+    if (u->cacheable && r->cache) {
         time_t  valid;
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,