changeset 386:1172e6d6f40f NGINX_0_7_5

nginx 0.7.5 *) Bugfixes in variables support in the "access_log" directive; the bug had appeared in 0.7.4. *) Bugfix: nginx could not be built --without-http_gzip_module; the bug had appeared in 0.7.3. Thanks to Kirill A. Korinskiy. *) Bugfix: if sub_filter and SSI were used together, then responses might were transferred incorrectly.
author Igor Sysoev <http://sysoev.ru>
date Tue, 01 Jul 2008 00:00:00 +0400
parents 08118f73d9f2
children 4cde8b18f2c9
files CHANGES CHANGES.ru src/core/nginx.h src/http/modules/ngx_http_log_module.c src/http/modules/ngx_http_ssi_filter_module.c src/http/modules/ngx_http_sub_filter_module.c src/http/modules/perl/nginx.pm src/http/ngx_http_header_filter_module.c src/http/ngx_http_request.c
diffstat 9 files changed, 46 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,17 @@
 
+Changes with nginx 0.7.5                                         01 Jul 2008
+
+    *) Bugfixes in variables support in the "access_log" directive; the bug 
+       had appeared in 0.7.4.
+
+    *) Bugfix: nginx could not be built --without-http_gzip_module; the bug 
+       had appeared in 0.7.3.
+       Thanks to Kirill A. Korinskiy.
+
+    *) Bugfix: if sub_filter and SSI were used together, then responses 
+       might were transferred incorrectly.
+
+
 Changes with nginx 0.7.4                                         30 Jun 2008
 
     *) Feature: variables support in the "access_log" directive.
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,17 @@
 
+Изменения в nginx 0.7.5                                           01.07.2008
+
+    *) Исправления в поддержке переменных в директиве access_log; ошибка 
+       появилась в 0.7.4.
+
+    *) Исправление: nginx не собирался с параметром 
+       --without-http_gzip_module; ошибка появилась в 0.7.3.
+       Спасибо Кириллу Коринскому.
+
+    *) Исправление: при совместном использовании sub_filter и SSI ответы 
+       могли передаваться неверно.
+
+
 Изменения в nginx 0.7.4                                           30.06.2008
 
     *) Добавление: директива access_log поддерживает переменные.
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VERSION      "0.7.4"
+#define NGINX_VERSION      "0.7.5"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -422,7 +422,8 @@ ngx_http_log_script_write(ngx_http_reque
     {
         ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
                       ngx_open_file_n " \"%s\" failed", log.data);
-        return -1;
+        /* simulate successfull logging */
+        return len;
     }
 
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -760,7 +761,8 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *
         return NGX_CONF_OK;
     }
 
-    *conf = *prev;
+    conf->logs = prev->logs;
+    conf->off = prev->off;
 
     if (conf->logs || conf->off) {
         return NGX_CONF_OK;
@@ -781,6 +783,7 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *
         return NGX_CONF_ERROR;
     }
 
+    log->script = NULL;
     log->disk_full_time = 0;
     log->error_log_time = 0;
 
--- a/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -558,8 +558,9 @@ ngx_http_ssi_body_filter(ngx_http_reques
                     if (b->in_file) {
                         if (slcf->min_file_chunk < (size_t) (b->last - b->pos))
                         {
-                            b->file_last = b->file_pos + (b->last - b->start);
-                            b->file_pos += b->pos - b->start;
+                            b->file_last = b->file_pos
+                                                   + (b->last - ctx->buf->pos);
+                            b->file_pos += b->pos - ctx->buf->pos;
 
                         } else {
                             b->in_file = 0;
--- a/src/http/modules/ngx_http_sub_filter_module.c
+++ b/src/http/modules/ngx_http_sub_filter_module.c
@@ -322,8 +322,8 @@ ngx_http_sub_body_filter(ngx_http_reques
                 b->recycled = 0;
 
                 if (b->in_file) {
-                    b->file_last = b->file_pos + (b->last - b->start);
-                    b->file_pos += b->pos - b->start;
+                    b->file_last = b->file_pos + (b->last - ctx->buf->pos);
+                    b->file_pos += b->pos - ctx->buf->pos;
                 }
 
                 cl->next = NULL;
--- 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.4';
+our $VERSION = '0.7.5';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http_header_filter_module.c
+++ b/src/http/ngx_http_header_filter_module.c
@@ -347,9 +347,11 @@ ngx_http_header_filter(ngx_http_request_
         len += sizeof("Connection: closed" CRLF) - 1;
     }
 
+#if (NGX_HTTP_GZIP)
     if (r->gzip && clcf->gzip_vary) {
         len += sizeof("Vary: Accept-Encoding" CRLF) - 1;
     }
+#endif
 
     part = &r->headers_out.headers.part;
     header = part->elts;
@@ -520,10 +522,12 @@ ngx_http_header_filter(ngx_http_request_
                              sizeof("Connection: close" CRLF) - 1);
     }
 
+#if (NGX_HTTP_GZIP)
     if (r->gzip && clcf->gzip_vary) {
         b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF,
                              sizeof("Vary: Accept-Encoding" CRLF) - 1);
     }
+#endif
 
     part = &r->headers_out.headers.part;
     header = part->elts;
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2623,6 +2623,8 @@ ngx_http_request_done(ngx_http_request_t
         r->headers_out.status = error;
     }
 
+    log->action = "logging request";
+
     cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
 
     log_handler = cmcf->phases[NGX_HTTP_LOG_PHASE].handlers.elts;
@@ -2631,6 +2633,8 @@ ngx_http_request_done(ngx_http_request_t
         log_handler[i](r);
     }
 
+    log->action = "closing request";
+
     if (r->connection->timedout) {
         clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);