upstream nginx-0.7.35 0.7.35 cd7f12d3e7e4eba82aeb709dc698289843f21696
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 21 Mar 2009 16:50:54 +0000 (17:50 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 21 Mar 2009 16:50:54 +0000 (17:50 +0100)
nginx/CHANGES
nginx/CHANGES.ru
nginx/src/core/nginx.h
nginx/src/core/ngx_hash.c
nginx/src/event/ngx_event_openssl.c
nginx/src/http/modules/perl/nginx.pm
nginx/src/http/ngx_http_core_module.c

index a4991d8..d8972e2 100644 (file)
@@ -1,4 +1,19 @@
 
 
+Changes with nginx 0.7.35                                        16 Feb 2009
+
+    *) Bugfix: a "ssl_engine" directive did not use a SSL-accelerator for 
+       asymmetric ciphers.
+       Thanks to Marcin Gozdalik.
+
+    *) Bugfix: a "try_files" directive set MIME type depending on an 
+       original request extension.
+
+    *) Bugfix: "*domain.tld" names were handled incorrectly in 
+       "server_name", "valid_referers", and "map" directives, if an 
+       ".domain.tld" and ".subdomain.domain.tld" wildcards were used; 
+       the bug had appeared in 0.7.9.
+
+
 Changes with nginx 0.7.34                                        10 Feb 2009
 
     *) Feature: the "off" parameter of the "if_modified_since" directive.
 Changes with nginx 0.7.34                                        10 Feb 2009
 
     *) Feature: the "off" parameter of the "if_modified_since" directive.
@@ -382,7 +397,7 @@ Changes with nginx 0.7.9                                         12 Aug 2008
 
     *) Bugfix: if the "server_name", "valid_referers", and "map" directives 
        used an "*.domain.tld" wildcard and exact name "domain.tld" was not 
 
     *) Bugfix: if the "server_name", "valid_referers", and "map" directives 
        used an "*.domain.tld" wildcard and exact name "domain.tld" was not 
-       set, then the exact name was matched by the wildcard; the bugs had 
+       set, then the exact name was matched by the wildcard; the bug had 
        appeared in 0.3.18.
 
 
        appeared in 0.3.18.
 
 
index d1eca6e..ad56b05 100644 (file)
@@ -1,4 +1,19 @@
 
 
+éÚÍÅÎÅÎÉÑ × nginx 0.7.35                                          16.02.2009
+
+    *) éÓÐÒÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Á ssl_engine ÎÅ ÉÓÐÏÌØÚÏ×ÁÌÁ SSL-ÁËÓÅÌÅÒÁÔÏÒ 
+       ÄÌÑ ÁÓÉÍÍÅÔÒÉÞÎÙÈ ÛÉÆÒÏ×.
+       óÐÁÓÉÂÏ Marcin Gozdalik.
+
+    *) éÓÐÒÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Á try_files ×ÙÓÔÁ×ÌÑÌÁ MIME-type, ÉÓÈÏÄÑ ÉÚ 
+       ÒÁÓÛÉÒÅÎÉÑ ÐÅÒ×ÏÎÁÞÁÌØÎÏÇÏ ÚÁÐÒÏÓÁ.
+
+    *) éÓÐÒÁ×ÌÅÎÉÅ: × ÄÉÒÅËÔÉ×ÁÈ server_name, valid_referers É map 
+       ÎÅÐÒÁ×ÉÌØÎÏ ÏÂÒÁÂÁÔÙ×ÁÌÉÓØ ÉÍÅÎÁ ×ÉÄÁ "*domain.tld", ÅÓÌÉ 
+       ÉÓÐÏÌØÚÏ×ÁÌÉÓØ ÍÁÓËÉ ×ÉÄÁ ".domain.tld" É ".subdomain.domain.tld"; 
+       ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.9.
+
+
 éÚÍÅÎÅÎÉÑ × nginx 0.7.34                                          10.02.2009
 
     *) äÏÂÁ×ÌÅÎÉÅ: ÐÁÒÁÍÅÔÒ off × ÄÉÒÅËÔÉ×Å if_modified_since.
 éÚÍÅÎÅÎÉÑ × nginx 0.7.34                                          10.02.2009
 
     *) äÏÂÁ×ÌÅÎÉÅ: ÐÁÒÁÍÅÔÒ off × ÄÉÒÅËÔÉ×Å if_modified_since.
index 2eedecb..5a59792 100644 (file)
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VERSION      "0.7.34"
+#define NGINX_VERSION      "0.7.35"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
index dd28e7c..2eadbf3 100644 (file)
@@ -589,7 +589,7 @@ ngx_hash_wildcard_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names,
                 wdc->value = names[n].value;
             }
 
                 wdc->value = names[n].value;
             }
 
-            name->value = (void *) ((uintptr_t) wdc | (dot ? 3 : 1));
+            name->value = (void *) ((uintptr_t) wdc | (dot ? 3 : 2));
 
         } else if (dot) {
             name->value = (void *) ((uintptr_t) name->value | 1);
 
         } else if (dot) {
             name->value = (void *) ((uintptr_t) name->value | 1);
index c963c95..0824e7a 100644 (file)
@@ -10,7 +10,7 @@
 
 
 typedef struct {
 
 
 typedef struct {
-    ngx_str_t  engine;
+    ngx_uint_t  engine;   /* unsigned  engine:1; */
 } ngx_openssl_conf_t;
 
 
 } ngx_openssl_conf_t;
 
 
@@ -37,26 +37,17 @@ static void ngx_ssl_session_rbtree_insert_value(ngx_rbtree_node_t *temp,
     ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
 
 static void *ngx_openssl_create_conf(ngx_cycle_t *cycle);
     ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
 
 static void *ngx_openssl_create_conf(ngx_cycle_t *cycle);
-static char *ngx_openssl_init_conf(ngx_cycle_t *cycle, void *conf);
+static char *ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 static void ngx_openssl_exit(ngx_cycle_t *cycle);
 
 static void ngx_openssl_exit(ngx_cycle_t *cycle);
 
-#if !(NGX_SSL_ENGINE)
-static char *ngx_openssl_noengine(ngx_conf_t *cf, ngx_command_t *cmd,
-     void *conf);
-#endif
-
 
 static ngx_command_t  ngx_openssl_commands[] = {
 
     { ngx_string("ssl_engine"),
       NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
 
 static ngx_command_t  ngx_openssl_commands[] = {
 
     { ngx_string("ssl_engine"),
       NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
-#if (NGX_SSL_ENGINE)
-      ngx_conf_set_str_slot,
-#else
-      ngx_openssl_noengine,
-#endif
+      ngx_openssl_engine,
+      0,
       0,
       0,
-      offsetof(ngx_openssl_conf_t, engine),
       NULL },
 
       ngx_null_command
       NULL },
 
       ngx_null_command
@@ -66,7 +57,7 @@ static ngx_command_t  ngx_openssl_commands[] = {
 static ngx_core_module_t  ngx_openssl_module_ctx = {
     ngx_string("openssl"),
     ngx_openssl_create_conf,
 static ngx_core_module_t  ngx_openssl_module_ctx = {
     ngx_string("openssl"),
     ngx_openssl_create_conf,
-    ngx_openssl_init_conf
+    NULL
 };
 
 
 };
 
 
@@ -2113,8 +2104,7 @@ ngx_openssl_create_conf(ngx_cycle_t *cycle)
     /*
      * set by ngx_pcalloc():
      *
     /*
      * set by ngx_pcalloc():
      *
-     *     oscf->engine.len = 0;
-     *     oscf->engine.data = NULL;
+     *     oscf->engine = 0;
      */
 
     return oscf;
      */
 
     return oscf;
@@ -2122,53 +2112,54 @@ ngx_openssl_create_conf(ngx_cycle_t *cycle)
 
 
 static char *
 
 
 static char *
-ngx_openssl_init_conf(ngx_cycle_t *cycle, void *conf)
+ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
 #if (NGX_SSL_ENGINE)
     ngx_openssl_conf_t *oscf = conf;
 
 {
 #if (NGX_SSL_ENGINE)
     ngx_openssl_conf_t *oscf = conf;
 
-    ENGINE  *engine;
+    ENGINE     *engine;
+    ngx_str_t  *value;
 
 
-    if (oscf->engine.len == 0) {
-        return NGX_CONF_OK;
+    if (oscf->engine) {
+        return "is duplicate";
     }
 
     }
 
-    engine = ENGINE_by_id((const char *) oscf->engine.data);
+    oscf->engine = 1;
+
+    value = cf->args->elts;
+
+    engine = ENGINE_by_id((const char *) value[1].data);
 
     if (engine == NULL) {
 
     if (engine == NULL) {
-        ngx_ssl_error(NGX_LOG_WARN, cycle->log, 0,
-                      "ENGINE_by_id(\"%V\") failed", &oscf->engine);
+        ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
+                      "ENGINE_by_id(\"%V\") failed", &value[1]);
         return NGX_CONF_ERROR;
     }
 
     if (ENGINE_set_default(engine, ENGINE_METHOD_ALL) == 0) {
         return NGX_CONF_ERROR;
     }
 
     if (ENGINE_set_default(engine, ENGINE_METHOD_ALL) == 0) {
-        ngx_ssl_error(NGX_LOG_WARN, cycle->log, 0,
+        ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
                       "ENGINE_set_default(\"%V\", ENGINE_METHOD_ALL) failed",
                       "ENGINE_set_default(\"%V\", ENGINE_METHOD_ALL) failed",
-                      &oscf->engine);
+                      &value[1]);
+
+        ENGINE_free(engine);
+
         return NGX_CONF_ERROR;
     }
 
     ENGINE_free(engine);
 
         return NGX_CONF_ERROR;
     }
 
     ENGINE_free(engine);
 
-#endif
-
     return NGX_CONF_OK;
     return NGX_CONF_OK;
-}
 
 
+#else
 
 
-#if !(NGX_SSL_ENGINE)
-
-static char *
-ngx_openssl_noengine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
     ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                        "\"ssl_engine\" directive is available only in "
                        "OpenSSL 0.9.7 and higher,");
 
     return NGX_CONF_ERROR;
     ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                        "\"ssl_engine\" directive is available only in "
                        "OpenSSL 0.9.7 and higher,");
 
     return NGX_CONF_ERROR;
-}
 
 #endif
 
 #endif
+}
 
 
 static void
 
 
 static void
index d5156af..90989da 100644 (file)
@@ -47,7 +47,7 @@ our @EXPORT = qw(
     HTTP_INSUFFICIENT_STORAGE
 );
 
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.7.34';
+our $VERSION = '0.7.35';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
index a21da0f..3f5cb29 100644 (file)
@@ -1197,6 +1197,11 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
             ngx_memcpy(p, name, path.len);
         }
 
             ngx_memcpy(p, name, path.len);
         }
 
+        if (ngx_http_set_exten(r) != NGX_OK) {
+            ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+            return NGX_OK;
+        }
+
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "try file uri: \"%V\"", &r->uri);
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "try file uri: \"%V\"", &r->uri);