]> git.kaiwu.me - nginx.git/commitdiff
Disabled duplicate http, mail, and stream blocks.
authorVladimir Homutov <vl@nginx.com>
Tue, 16 Jun 2015 20:28:38 +0000 (23:28 +0300)
committerVladimir Homutov <vl@nginx.com>
Tue, 16 Jun 2015 20:28:38 +0000 (23:28 +0300)
Such configurations have very limited use, introduce various problems and
are not officially supported.

src/http/ngx_http.c
src/mail/ngx_mail.c
src/stream/ngx_stream.c

index 4642559ea3f22d6f898ee522288be122193360c1..6b0a48f262286d5aee1a447545c02cc03b010781 100644 (file)
@@ -128,6 +128,10 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ngx_http_core_srv_conf_t   **cscfp;
     ngx_http_core_main_conf_t   *cmcf;
 
+    if (*(ngx_http_conf_ctx_t **) conf) {
+        return "is duplicate";
+    }
+
     /* the main http context */
 
     ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
index 38664bc87e333cd892807148d97a3f23e66073e6..962ae8be53d6d55d62367d63f84a687f794d5629 100644 (file)
@@ -76,6 +76,10 @@ ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ngx_mail_core_srv_conf_t   **cscfp;
     ngx_mail_core_main_conf_t   *cmcf;
 
+    if (*(ngx_mail_conf_ctx_t **) conf) {
+        return "is duplicate";
+    }
+
     /* the main mail context */
 
     ctx = ngx_pcalloc(cf->pool, sizeof(ngx_mail_conf_ctx_t));
index 3dce35ab71da5421fbf4c3ad04d3ca14927a91c7..f0aa532b6e17153107f03ecd8209450562803b4f 100644 (file)
@@ -76,6 +76,10 @@ ngx_stream_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ngx_stream_core_srv_conf_t   **cscfp;
     ngx_stream_core_main_conf_t   *cmcf;
 
+    if (*(ngx_stream_conf_ctx_t **) conf) {
+        return "is duplicate";
+    }
+
     /* the main stream context */
 
     ctx = ngx_pcalloc(cf->pool, sizeof(ngx_stream_conf_ctx_t));