changeset 610:7ea1bba9a4f6 NGINX_0_9_3

nginx 0.9.3 *) Bugfix: if there was a single server for given IPv6 address:port pair, then captures in regular expressions in a "server_name" directive did not work. *) Bugfix: nginx could not be built on Solaris; the bug had appeared in 0.9.0.
author Igor Sysoev <http://sysoev.ru>
date Mon, 13 Dec 2010 00:00:00 +0300
parents f6fa6099ee59
children f02ddde4a240
files CHANGES CHANGES.ru auto/unix src/core/nginx.h src/core/ngx_log.c src/http/modules/perl/nginx.pm src/http/ngx_http.c src/os/unix/ngx_process_cycle.c
diffstat 8 files changed, 76 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Mon Dec 06 00:00:00 2010 +0300
+++ b/CHANGES	Mon Dec 13 00:00:00 2010 +0300
@@ -1,4 +1,14 @@
 
+Changes with nginx 0.9.3                                         13 Dec 2010
+
+    *) Bugfix: if there was a single server for given IPv6 address:port 
+       pair, then captures in regular expressions in a "server_name" 
+       directive did not work.
+
+    *) Bugfix: nginx could not be built on Solaris; the bug had appeared in 
+       0.9.0.
+
+
 Changes with nginx 0.9.2                                         06 Dec 2010
 
     *) Feature: the "If-Unmodified-Since" client request header line 
@@ -7,8 +17,8 @@
     *) Workaround: fallback to accept() syscall if accept4() was not 
        implemented; the issue had appeared in 0.9.0.
 
-    *) Bugfix: nginx could not be built on Cygwin; the issue had appeared 
-       in 0.9.0.
+    *) Bugfix: nginx could not be built on Cygwin; the bug had appeared in 
+       0.9.0.
 
     *) Bugfix: for OpenSSL vulnerability CVE-2010-4180.
        Thanks to Maxim Dounin.
@@ -1255,7 +1265,7 @@
 
     *) Bugfix: the "try_files" directive might test incorrectly directories.
 
-    *) Bugfix: if there is the single server for given address:port pair, 
+    *) Bugfix: if there was a single server for given address:port pair, 
        then captures in regular expressions in a "server_name" directive 
        did not work.
 
--- a/CHANGES.ru	Mon Dec 06 00:00:00 2010 +0300
+++ b/CHANGES.ru	Mon Dec 13 00:00:00 2010 +0300
@@ -1,4 +1,14 @@
 
+Изменения в nginx 0.9.3                                           13.12.2010
+
+    *) Исправление: если для пары адрес:порт описан только один сервер, то 
+       выделения в регулярных выражениях в директиве server_name не 
+       работали.
+
+    *) Исправление: nginx не собирался под Solaris; ошибка появилась в 
+       0.9.0.
+
+
 Изменения в nginx 0.9.2                                           06.12.2010
 
     *) Добавление: поддержка строки "If-Unmodified-Since" в заголовке 
--- a/auto/unix	Mon Dec 06 00:00:00 2010 +0300
+++ b/auto/unix	Mon Dec 13 00:00:00 2010 +0300
@@ -119,16 +119,42 @@
 . auto/feature
 
 
-# Cygiwn defines _sys_nerr
-ngx_feature="_sys_nerr"
-ngx_feature_name="NGX_SYS_NERR"
-ngx_feature_run=value
-ngx_feature_incs='#include <errno.h>
-                  #include <stdio.h>'
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test='printf("%d", _sys_nerr);'
-. auto/feature
+if [ $ngx_found = no ]; then
+
+    # Cygiwn defines _sys_nerr
+    ngx_feature="_sys_nerr"
+    ngx_feature_name="NGX_SYS_NERR"
+    ngx_feature_run=value
+    ngx_feature_incs='#include <errno.h>
+                      #include <stdio.h>'
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test='printf("%d", _sys_nerr);'
+    . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+    # Solaris has no sys_nerr
+    ngx_feature='maximum errno'
+    ngx_feature_name=NGX_SYS_NERR
+    ngx_feature_run=value
+    ngx_feature_incs='#include <errno.h>
+                      #include <stdio.h>'
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test='int  n;
+                      for (n = 1; n < 1000; n++) {
+                          errno = 0;
+                          strerror(n);
+                          if (errno == EINVAL) {
+                              printf("%d", n);
+                              return 0;
+                          }
+                     }'
+    . auto/feature
+fi
 
 
 ngx_feature="localtime_r()"
--- a/src/core/nginx.h	Mon Dec 06 00:00:00 2010 +0300
+++ b/src/core/nginx.h	Mon Dec 13 00:00:00 2010 +0300
@@ -8,8 +8,8 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define nginx_version         9002
-#define NGINX_VERSION      "0.9.2"
+#define nginx_version         9003
+#define NGINX_VERSION      "0.9.3"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/core/ngx_log.c	Mon Dec 06 00:00:00 2010 +0300
+++ b/src/core/ngx_log.c	Mon Dec 13 00:00:00 2010 +0300
@@ -148,9 +148,9 @@
         return;
     }
 
-    msg -= (7 + err_levels[level].len + 4);
+    msg -= (7 + err_levels[level].len + 3);
 
-    (void) ngx_sprintf(msg, "nginx: [%V]: ", &err_levels[level]);
+    (void) ngx_sprintf(msg, "nginx: [%V] ", &err_levels[level]);
 
     (void) ngx_write_console(ngx_stderr, msg, p - msg);
 }
--- a/src/http/modules/perl/nginx.pm	Mon Dec 06 00:00:00 2010 +0300
+++ b/src/http/modules/perl/nginx.pm	Mon Dec 13 00:00:00 2010 +0300
@@ -48,7 +48,7 @@
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.9.2';
+our $VERSION = '0.9.3';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http.c	Mon Dec 06 00:00:00 2010 +0300
+++ b/src/http/ngx_http.c	Mon Dec 13 00:00:00 2010 +0300
@@ -1502,7 +1502,7 @@
             }
 
             if (rc == NGX_BUSY) {
-            ngx_log_error(NGX_LOG_WARN, cf->log, 0,
+                ngx_log_error(NGX_LOG_WARN, cf->log, 0,
                               "conflicting server name \"%V\" on %s, ignored",
                               &name[n].name, addr->opt.addr);
             }
@@ -1870,8 +1870,12 @@
         if (addr[i].hash.buckets == NULL
             && (addr[i].wc_head == NULL
                 || addr[i].wc_head->hash.buckets == NULL)
-            && (addr[i].wc_head == NULL
-                || addr[i].wc_head->hash.buckets == NULL))
+            && (addr[i].wc_tail == NULL
+                || addr[i].wc_tail->hash.buckets == NULL)
+#if (NGX_PCRE)
+            && addr[i].nregex == 0
+#endif
+            )
         {
             continue;
         }
--- a/src/os/unix/ngx_process_cycle.c	Mon Dec 06 00:00:00 2010 +0300
+++ b/src/os/unix/ngx_process_cycle.c	Mon Dec 13 00:00:00 2010 +0300
@@ -291,6 +291,11 @@
 {
     ngx_uint_t  i;
 
+    if (ngx_set_environment(cycle, NULL) == NULL) {
+        /* fatal */
+        exit(2);
+    }
+
     for (i = 0; ngx_modules[i]; i++) {
         if (ngx_modules[i]->init_process) {
             if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {