changeset 292:92402f034b28 NGINX_0_5_16

nginx 0.5.16 *) Bugfix: the C-class network was not used as hash key in the "ip_hash" directive. Thanks to Pavel Yarkovoy. *) Bugfix: a segmentation fault might occur in worker process if a charset was set in the "Content-Type" header line and the line has trailing ";"; bug appeared in 0.3.50. *) Bugfix: the "[alert] zero size buf" error when FastCGI server was used and an request body written in a temporary file was multiple of 32K. *) Bugfix: nginx could not be built on Solaris without the --with-debug option; bug appeared in 0.5.15.
author Igor Sysoev <http://sysoev.ru>
date Mon, 26 Mar 2007 00:00:00 +0400
parents b87a3cfad343
children 30378812e3af
files CHANGES CHANGES.ru src/core/nginx.h src/event/modules/ngx_devpoll_module.c src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/perl/nginx.pm src/http/ngx_http_upstream.c
diffstat 8 files changed, 54 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES
+++ b/CHANGES
@@ -1,10 +1,31 @@
 
+Changes with nginx 0.5.16                                        26 Mar 2007
+
+    *) Bugfix: the C-class network was not used as hash key in the 
+       "ip_hash" directive.
+       Thanks to Pavel Yarkovoy.
+
+    *) Bugfix: a segmentation fault might occur in worker process if a 
+       charset was set in the "Content-Type" header line and the line has 
+       trailing ";"; bug appeared in 0.3.50.
+
+    *) Bugfix: the "[alert] zero size buf" error when FastCGI server was 
+       used and an request body written in a temporary file was multiple of 
+       32K.
+
+    *) Bugfix: nginx could not be built on Solaris without the --with-debug 
+       option; bug appeared in 0.5.15.
+
+
 Changes with nginx 0.5.15                                        19 Mar 2007
 
     *) Feature: the mail proxy supports authenticated SMTP proxying and the 
        "smtp_auth", "smtp_capablities", and "xclient" directives.
        Thanks to Anton Yuzhaninov and Maxim Dounin.
 
+    *) Feature: now the keep-alive connections are closed just after 
+       receiving the reconfiguration signal.
+
     *) Change: the "imap" and "auth" directives were renamed to the "mail" 
        and "pop3_auth" directives.
 
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,22 @@
 
+Изменения в nginx 0.5.16                                          26.03.2007
+
+    *) Исправление: в качестве ключа для хэша в директиве ip_hash не 
+       использовалась сеть класса С.
+       Спасибо Павлу Ярковому.
+
+    *) Исправление: если в строке "Content-Type" в заголовке ответа бэкенда 
+       был указан charset и строка завершалась символом ";", то в рабочем 
+       процессе мог произойти segmentation fault; ошибка появилась в 0.3.50.
+
+    *) Исправление: ошибки "[alert] zero size buf" при работе с 
+       FastCGI-сервером, если тело запроса, записанное во временный файл, 
+       было кратно 32K.
+
+    *) Исправление: nginx не собирался на Solaris без параметра 
+       --with-debug; ошибка появилась в 0.5.15.
+
+
 Изменения в nginx 0.5.15                                          19.03.2007
 
     *) Добавление: почтовый прокси-сервер поддерживает аутентифицированное 
@@ -6,6 +24,9 @@
        xclient.
        Спасибо Антону Южанинову и Максиму Дунину.
 
+    *) Добавление: теперь keep-alive соединения закрываются сразу же по 
+       получении сигнала переконфигурации.
+
     *) Изменение: директивы imap и auth переименованы соответственно в mail 
        и pop3_auth.
 
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VERSION      "0.5.15"
+#define NGINX_VERSION      "0.5.16"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/event/modules/ngx_devpoll_module.c
+++ b/src/event/modules/ngx_devpoll_module.c
@@ -416,7 +416,7 @@ ngx_devpoll_process_events(ngx_cycle_t *
                        event_list[i].fd, event_list[i].events, revents);
 
         if (revents & (POLLERR|POLLHUP|POLLNVAL)) {
-            ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
+            ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
                           "ioctl(DP_POLL) error fd:%d ev:%04Xd rev:%04Xd",
                           event_list[i].fd, event_list[i].events, revents);
         }
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -723,7 +723,7 @@ ngx_http_fastcgi_create_request(ngx_http
                     b->file_pos = file_pos;
                     file_pos += 32 * 1024;
 
-                    if (file_pos > body->buf->file_last) {
+                    if (file_pos >= body->buf->file_last) {
                         file_pos = body->buf->file_last;
                         next = 1;
                     }
@@ -735,7 +735,7 @@ ngx_http_fastcgi_create_request(ngx_http
                     b->pos = pos;
                     pos += 32 * 1024;
 
-                    if (pos > body->buf->last) {
+                    if (pos >= body->buf->last) {
                         pos = body->buf->last;
                         next = 1;
                     }
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
@@ -93,6 +93,7 @@ static ngx_int_t
 ngx_http_upstream_init_ip_hash_peer(ngx_http_request_t *r,
     ngx_http_upstream_srv_conf_t *us)
 {
+    u_char                                 *p;
     struct sockaddr_in                     *sin;
     ngx_http_upstream_ip_hash_peer_data_t  *iphp;
 
@@ -111,9 +112,10 @@ ngx_http_upstream_init_ip_hash_peer(ngx_
 
     /* AF_INET only */
     sin = (struct sockaddr_in *) r->connection->sockaddr;
-    iphp->addr[0] = (u_char) ((sin->sin_addr.s_addr >> 24) & 0xff);
-    iphp->addr[1] = (u_char) ((sin->sin_addr.s_addr >> 16) & 0xff);
-    iphp->addr[2] = (u_char) ((sin->sin_addr.s_addr >> 8) & 0xff);
+    p = (u_char *) &sin->sin_addr.s_addr;
+    iphp->addr[0] = p[0];
+    iphp->addr[1] = p[1];
+    iphp->addr[2] = p[2];
 
     iphp->hash = 89;
     iphp->tries = 0;
--- 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.5.15';
+our $VERSION = '0.5.16';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2326,6 +2326,8 @@ ngx_http_upstream_copy_content_type(ngx_
 
         r->headers_out.charset.len = h->value.data + h->value.len - p;
         r->headers_out.charset.data = p;
+
+        return NGX_OK;
     }
 
     return NGX_OK;