Skip to content

Commit

Permalink
Disabled duplicate http, mail, and stream blocks.
Browse files Browse the repository at this point in the history
Such configurations have very limited use, introduce various problems and
are not officially supported.
  • Loading branch information
vlhomutov committed Jun 16, 2015
1 parent 9efe6c2 commit b7a8f2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/http/ngx_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 4 additions & 0 deletions src/mail/ngx_mail.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 4 additions & 0 deletions src/stream/ngx_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit b7a8f2a

Please sign in to comment.