diff options
Diffstat (limited to 'src/mail/ngx_mail_core_module.c')
-rw-r--r-- | src/mail/ngx_mail_core_module.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c index ad785fd99..91b425f7f 100644 --- a/src/mail/ngx_mail_core_module.c +++ b/src/mail/ngx_mail_core_module.c @@ -154,13 +154,14 @@ ngx_mail_core_create_srv_conf(ngx_conf_t *cf) * set by ngx_pcalloc(): * * cscf->protocol = NULL; - * cscf->resolver = NULL; */ cscf->timeout = NGX_CONF_UNSET_MSEC; cscf->resolver_timeout = NGX_CONF_UNSET_MSEC; cscf->so_keepalive = NGX_CONF_UNSET; + cscf->resolver = NGX_CONF_UNSET_PTR; + cscf->file_name = cf->conf_file->file.name.data; cscf->line = cf->conf_file->line; @@ -207,9 +208,7 @@ ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) return NGX_CONF_ERROR; } - if (conf->resolver == NULL) { - conf->resolver = prev->resolver; - } + ngx_conf_merge_ptr_value(conf->resolver, prev->resolver, NULL); return NGX_CONF_OK; } @@ -423,6 +422,11 @@ ngx_mail_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) value = cf->args->elts; + if (ngx_strcmp(value[1].data, "off") == 0) { + cscf->resolver = NULL; + return NGX_CONF_OK; + } + ngx_memzero(&u, sizeof(ngx_url_t)); u.host = value[1]; @@ -435,7 +439,7 @@ ngx_mail_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) cscf->resolver = ngx_resolver_create(&u.addrs[0], cf->cycle->new_log); if (cscf->resolver == NULL) { - return NGX_OK; + return NGX_CONF_OK; } return NGX_CONF_OK; |