diff options
author | Ruslan Ermilov <ru@nginx.com> | 2012-08-15 11:30:24 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2012-08-15 11:30:24 +0000 |
commit | 9aac01a76edeccd7760e99de23eac7e447cf4fde (patch) | |
tree | 389251609abfdcc258f82bfec2d652aaa0c3d09c /src | |
parent | 89ad2e91e5bc3f0e8699bdf72b21bfbb5942943e (diff) | |
download | nginx-9aac01a76edeccd7760e99de23eac7e447cf4fde.tar.gz nginx-9aac01a76edeccd7760e99de23eac7e447cf4fde.zip |
mail_core: don't let the well-known port in the "listen" directive to
override the already set "protocol".
Diffstat (limited to 'src')
-rw-r--r-- | src/mail/ngx_mail_core_module.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c index f0dee7283..ecb722994 100644 --- a/src/mail/ngx_mail_core_module.c +++ b/src/mail/ngx_mail_core_module.c @@ -378,21 +378,23 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ls->ipv6only = 1; #endif - for (m = 0; ngx_modules[m]; m++) { - if (ngx_modules[m]->type != NGX_MAIL_MODULE) { - continue; - } - - module = ngx_modules[m]->ctx; - - if (module->protocol == NULL) { - continue; - } - - for (i = 0; module->protocol->port[i]; i++) { - if (module->protocol->port[i] == u.port) { - cscf->protocol = module->protocol; - break; + if (cscf->protocol == NULL) { + for (m = 0; ngx_modules[m]; m++) { + if (ngx_modules[m]->type != NGX_MAIL_MODULE) { + continue; + } + + module = ngx_modules[m]->ctx; + + if (module->protocol == NULL) { + continue; + } + + for (i = 0; module->protocol->port[i]; i++) { + if (module->protocol->port[i] == u.port) { + cscf->protocol = module->protocol; + break; + } } } } |