# HG changeset patch # User Vladimir Homutov # Date 1434486518 -10800 # Node ID 78c06e5e1d764f802c33cabcea0ccb30ab4e85dc # Parent 7863b167dbf9f34a535e89ade6df1995b71da654 Disabled duplicate http, mail, and stream blocks. Such configurations have very limited use, introduce various problems and are not officially supported. diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -128,6 +128,10 @@ ngx_http_block(ngx_conf_t *cf, ngx_comma 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 --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -76,6 +76,10 @@ ngx_mail_block(ngx_conf_t *cf, ngx_comma 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 --- a/src/stream/ngx_stream.c +++ b/src/stream/ngx_stream.c @@ -76,6 +76,10 @@ ngx_stream_block(ngx_conf_t *cf, ngx_com 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));