diff options
author | Roman Arutyunyan <arut@nginx.com> | 2016-08-17 11:26:51 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2016-08-17 11:26:51 +0300 |
commit | dabbf30377d422a0e40093e3f429fca352c633a1 (patch) | |
tree | 5352faa0d775f8dd21fd35dfcb01ce1fd66bd6fb /src/mail/ngx_mail_core_module.c | |
parent | eecc68ce1787a519e4cf195f12c887d7d2ba9b0a (diff) | |
download | nginx-dabbf30377d422a0e40093e3f429fca352c633a1.tar.gz nginx-dabbf30377d422a0e40093e3f429fca352c633a1.zip |
Ensure "listen" exists in a mail or stream server (ticket #1049).
Diffstat (limited to 'src/mail/ngx_mail_core_module.c')
-rw-r--r-- | src/mail/ngx_mail_core_module.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c index d992402b8..48eacfa28 100644 --- a/src/mail/ngx_mail_core_module.c +++ b/src/mail/ngx_mail_core_module.c @@ -279,6 +279,13 @@ ngx_mail_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) *cf = pcf; + if (rv == NGX_CONF_OK && !cscf->listen) { + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "no \"listen\" is defined for server in %s:%ui", + cscf->file_name, cscf->line); + return NGX_CONF_ERROR; + } + return rv; } @@ -295,6 +302,8 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_mail_module_t *module; ngx_mail_core_main_conf_t *cmcf; + cscf->listen = 1; + value = cf->args->elts; ngx_memzero(&u, sizeof(ngx_url_t)); |