]> git.kaiwu.me - nginx.git/commitdiff
allow duplicate listen ssl options
authorIgor Sysoev <igor@sysoev.ru>
Mon, 27 Sep 2010 11:48:12 +0000 (11:48 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 27 Sep 2010 11:48:12 +0000 (11:48 +0000)
src/http/ngx_http.c
src/http/ngx_http_core_module.c

index f9aa44c1ed5094791b76b9d6ac03ea1233297ba3..58fc7afe5b87a37baedb835ed3d228569adfd04b 100644 (file)
@@ -1221,6 +1221,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
 #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 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
         /* 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 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
         }
 
         addr[i].opt.default_server = default_server;
+#if (NGX_HTTP_SSL)
+        addr[i].opt.ssl = ssl;
+#endif
 
         return NGX_OK;
     }
index d29d20844ebfa29ebb4da302b63115a54cfee2ab..73cde3d82a0b5c5ff2fffb116561bae3f38b8c72 100644 (file)
@@ -3569,7 +3569,6 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
         if (ngx_strcmp(value[n].data, "ssl") == 0) {
 #if (NGX_HTTP_SSL)
-            lsopt.set = 1;
             lsopt.ssl = 1;
             continue;
 #else