aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2015-06-16 23:28:38 +0300
committerVladimir Homutov <vl@nginx.com>2015-06-16 23:28:38 +0300
commitb7a8f2a08f6a2f777de5e0cef85aed615a9f057d (patch)
tree1e33e1b87f8643ae091aa0dbe5c1fb7f949b8eba /src
parent9efe6c224368bc46c402b2f70c45d550cb13c515 (diff)
downloadnginx-b7a8f2a08f6a2f777de5e0cef85aed615a9f057d.tar.gz
nginx-b7a8f2a08f6a2f777de5e0cef85aed615a9f057d.zip
Disabled duplicate http, mail, and stream blocks.
Such configurations have very limited use, introduce various problems and are not officially supported.
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http.c4
-rw-r--r--src/mail/ngx_mail.c4
-rw-r--r--src/stream/ngx_stream.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 4642559ea..6b0a48f26 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -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));
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c
index 38664bc87..962ae8be5 100644
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -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));
diff --git a/src/stream/ngx_stream.c b/src/stream/ngx_stream.c
index 3dce35ab7..f0aa532b6 100644
--- a/src/stream/ngx_stream.c
+++ b/src/stream/ngx_stream.c
@@ -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));