changeset 598:be70f83b184f NGINX_0_8_51

nginx 0.8.51 *) Change: the "secure_link_expires" directive has been canceled. *) Change: a logging level of resolver errors has been lowered from "alert" to "error". *) Feature: now a listen socket "ssl" parameter may be set several times.
author Igor Sysoev <http://sysoev.ru>
date Mon, 27 Sep 2010 00:00:00 +0400
parents 1695031dbfed
children ba5a8beb9f72
files CHANGES CHANGES.ru src/core/nginx.c src/core/nginx.h src/core/ngx_cycle.h src/core/ngx_resolver.c src/http/modules/ngx_http_secure_link_module.c src/http/modules/perl/nginx.pm src/http/ngx_http.c src/http/ngx_http_core_module.c src/http/ngx_http_script.c src/http/ngx_http_script.h src/os/unix/ngx_process_cycle.c
diffstat 13 files changed, 56 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Thu Sep 02 00:00:00 2010 +0400
+++ b/CHANGES	Mon Sep 27 00:00:00 2010 +0400
@@ -1,4 +1,15 @@
 
+Changes with nginx 0.8.51                                        27 Sep 2010
+
+    *) Change: the "secure_link_expires" directive has been canceled.
+
+    *) Change: a logging level of resolver errors has been lowered from 
+       "alert" to "error".
+
+    *) Feature: now a listen socket "ssl" parameter may be set several 
+       times.
+
+
 Changes with nginx 0.8.50                                        02 Sep 2010
 
     *) Feature: the "secure_link", "secure_link_md5", and 
--- a/CHANGES.ru	Thu Sep 02 00:00:00 2010 +0400
+++ b/CHANGES.ru	Mon Sep 27 00:00:00 2010 +0400
@@ -1,4 +1,15 @@
 
+Изменения в nginx 0.8.51                                          27.09.2010
+
+    *) Изменение: директива secure_link_expires упразднена.
+
+    *) Изменение: уровень логгирования ошибок resolver'а понижен с уровня 
+       alert на error.
+
+    *) Добавление: теперь параметр "ssl" listen-сокета можно устанавливать 
+       несколько раз.
+
+
 Изменения в nginx 0.8.50                                          02.09.2010
 
     *) Добавление: директивы secure_link, secure_link_md5 и 
--- a/src/core/nginx.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/core/nginx.c	Mon Sep 27 00:00:00 2010 +0400
@@ -110,7 +110,7 @@
 
     { ngx_string("worker_rlimit_core"),
       NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
-      ngx_conf_set_size_slot,
+      ngx_conf_set_off_slot,
       0,
       offsetof(ngx_core_conf_t, rlimit_core),
       NULL },
@@ -941,7 +941,7 @@
     ccf->debug_points = NGX_CONF_UNSET;
 
     ccf->rlimit_nofile = NGX_CONF_UNSET;
-    ccf->rlimit_core = NGX_CONF_UNSET_SIZE;
+    ccf->rlimit_core = NGX_CONF_UNSET;
     ccf->rlimit_sigpending = NGX_CONF_UNSET;
 
     ccf->user = (ngx_uid_t) NGX_CONF_UNSET_UINT;
--- a/src/core/nginx.h	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/core/nginx.h	Mon Sep 27 00:00:00 2010 +0400
@@ -8,8 +8,8 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define nginx_version         8050
-#define NGINX_VERSION      "0.8.50"
+#define nginx_version         8051
+#define NGINX_VERSION      "0.8.51"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/core/ngx_cycle.h	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/core/ngx_cycle.h	Mon Sep 27 00:00:00 2010 +0400
@@ -78,7 +78,7 @@
 
      ngx_int_t                rlimit_nofile;
      ngx_int_t                rlimit_sigpending;
-     size_t                   rlimit_core;
+     off_t                    rlimit_core;
 
      int                      priority;
 
--- a/src/core/ngx_resolver.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/core/ngx_resolver.c	Mon Sep 27 00:00:00 2010 +0400
@@ -138,7 +138,7 @@
     r->valid = 300;
 
     r->log = &cf->cycle->new_log;
-    r->log_level = NGX_LOG_ALERT;
+    r->log_level = NGX_LOG_ERR;
 
     if (addr) {
         uc = ngx_calloc(sizeof(ngx_udp_connection_t), cf->log);
--- a/src/http/modules/ngx_http_secure_link_module.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/http/modules/ngx_http_secure_link_module.c	Mon Sep 27 00:00:00 2010 +0400
@@ -14,7 +14,6 @@
     ngx_http_complex_value_t  *variable;
     ngx_http_complex_value_t  *md5;
     ngx_str_t                  secret;
-    ngx_flag_t                 expires;
 } ngx_http_secure_link_conf_t;
 
 
@@ -38,25 +37,18 @@
 
     { ngx_string("secure_link"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
-      ngx_http_set_comlex_value_slot,
+      ngx_http_set_complex_value_slot,
       NGX_HTTP_LOC_CONF_OFFSET,
       offsetof(ngx_http_secure_link_conf_t, variable),
       NULL },
 
     { ngx_string("secure_link_md5"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
-      ngx_http_set_comlex_value_slot,
+      ngx_http_set_complex_value_slot,
       NGX_HTTP_LOC_CONF_OFFSET,
       offsetof(ngx_http_secure_link_conf_t, md5),
       NULL },
 
-    { ngx_string("secure_link_expires"),
-      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
-      ngx_conf_set_flag_slot,
-      NGX_HTTP_LOC_CONF_OFFSET,
-      offsetof(ngx_http_secure_link_conf_t, expires),
-      NULL },
-
     { ngx_string("secure_link_secret"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
       ngx_conf_set_str_slot,
@@ -141,22 +133,20 @@
     if (p) {
         val.len = p++ - val.data;
 
-        if (conf->expires) {
-            expires = ngx_atotm(p, last - p);
-            if (expires <= 0) {
-                goto not_found;
-            }
+        expires = ngx_atotm(p, last - p);
+        if (expires <= 0) {
+            goto not_found;
+        }
 
-            ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_secure_link_ctx_t));
-            if (ctx == NULL) {
-                return NGX_ERROR;
-            }
+        ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_secure_link_ctx_t));
+        if (ctx == NULL) {
+            return NGX_ERROR;
+        }
 
-            ngx_http_set_ctx(r, ctx, ngx_http_secure_link_module);
+        ngx_http_set_ctx(r, ctx, ngx_http_secure_link_module);
 
-            ctx->expires.len = last - p;
-            ctx->expires.data = p;
-        }
+        ctx->expires.len = last - p;
+        ctx->expires.data = p;
     }
 
     if (val.len > 24) {
@@ -317,8 +307,6 @@
      *     conf->secret = { 0, NULL };
      */
 
-    conf->expires = NGX_CONF_UNSET;
-
     return conf;
 }
 
@@ -339,8 +327,6 @@
         conf->md5 = prev->md5;
     }
 
-    ngx_conf_merge_value(conf->expires, prev->expires, 0);
-
     return NGX_CONF_OK;
 }
 
--- a/src/http/modules/perl/nginx.pm	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/http/modules/perl/nginx.pm	Mon Sep 27 00:00:00 2010 +0400
@@ -48,7 +48,7 @@
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.8.50';
+our $VERSION = '0.8.51';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/http/ngx_http.c	Mon Sep 27 00:00:00 2010 +0400
@@ -1221,6 +1221,9 @@
 #if (NGX_HAVE_UNIX_DOMAIN)
     struct sockaddr_un    *saun;
 #endif
+#if (NGX_HTTP_SSL)
+    ngx_uint_t             ssl;
+#endif
 
     /*
      * we can not compare whole sockaddr struct's as kernel
@@ -1270,6 +1273,10 @@
         /* preserve default_server bit during listen options overwriting */
         default_server = addr[i].opt.default_server;
 
+#if (NGX_HTTP_SSL)
+        ssl = lsopt->ssl || addr[i].opt.set;
+#endif
+
         if (lsopt->set) {
 
             if (addr[i].opt.set) {
@@ -1296,6 +1303,9 @@
         }
 
         addr[i].opt.default_server = default_server;
+#if (NGX_HTTP_SSL)
+        addr[i].opt.ssl = ssl;
+#endif
 
         return NGX_OK;
     }
--- a/src/http/ngx_http_core_module.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/http/ngx_http_core_module.c	Mon Sep 27 00:00:00 2010 +0400
@@ -3569,7 +3569,6 @@
 
         if (ngx_strcmp(value[n].data, "ssl") == 0) {
 #if (NGX_HTTP_SSL)
-            lsopt.set = 1;
             lsopt.ssl = 1;
             continue;
 #else
--- a/src/http/ngx_http_script.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/http/ngx_http_script.c	Mon Sep 27 00:00:00 2010 +0400
@@ -212,7 +212,7 @@
 
 
 char *
-ngx_http_set_comlex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+ngx_http_set_complex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
--- a/src/http/ngx_http_script.h	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/http/ngx_http_script.h	Mon Sep 27 00:00:00 2010 +0400
@@ -207,7 +207,7 @@
 ngx_int_t ngx_http_complex_value(ngx_http_request_t *r,
     ngx_http_complex_value_t *val, ngx_str_t *value);
 ngx_int_t ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv);
-char * ngx_http_set_comlex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd,
+char *ngx_http_set_complex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 
 
--- a/src/os/unix/ngx_process_cycle.c	Thu Sep 02 00:00:00 2010 +0400
+++ b/src/os/unix/ngx_process_cycle.c	Mon Sep 27 00:00:00 2010 +0400
@@ -856,13 +856,13 @@
         }
     }
 
-    if (ccf->rlimit_core != NGX_CONF_UNSET_SIZE) {
+    if (ccf->rlimit_core != NGX_CONF_UNSET) {
         rlmt.rlim_cur = (rlim_t) ccf->rlimit_core;
         rlmt.rlim_max = (rlim_t) ccf->rlimit_core;
 
         if (setrlimit(RLIMIT_CORE, &rlmt) == -1) {
             ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
-                          "setrlimit(RLIMIT_CORE, %i) failed",
+                          "setrlimit(RLIMIT_CORE, %O) failed",
                           ccf->rlimit_core);
         }
     }