comparison src/mail/ngx_mail_core_module.c @ 4813:5c47ecaef07a

mail_core: don't let the well-known port in the "listen" directive to override the already set "protocol".
author Ruslan Ermilov <ru@nginx.com>
date Wed, 15 Aug 2012 11:30:24 +0000
parents bdcdbdf35b52
children 49a3fb31a05c
comparison
equal deleted inserted replaced
4812:785ae4de268b 4813:5c47ecaef07a
376 376
377 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 377 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
378 ls->ipv6only = 1; 378 ls->ipv6only = 1;
379 #endif 379 #endif
380 380
381 for (m = 0; ngx_modules[m]; m++) { 381 if (cscf->protocol == NULL) {
382 if (ngx_modules[m]->type != NGX_MAIL_MODULE) { 382 for (m = 0; ngx_modules[m]; m++) {
383 continue; 383 if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
384 } 384 continue;
385 385 }
386 module = ngx_modules[m]->ctx; 386
387 387 module = ngx_modules[m]->ctx;
388 if (module->protocol == NULL) { 388
389 continue; 389 if (module->protocol == NULL) {
390 } 390 continue;
391 391 }
392 for (i = 0; module->protocol->port[i]; i++) { 392
393 if (module->protocol->port[i] == u.port) { 393 for (i = 0; module->protocol->port[i]; i++) {
394 cscf->protocol = module->protocol; 394 if (module->protocol->port[i] == u.port) {
395 break; 395 cscf->protocol = module->protocol;
396 break;
397 }
396 } 398 }
397 } 399 }
398 } 400 }
399 401
400 for (i = 2; i < cf->args->nelts; i++) { 402 for (i = 2; i < cf->args->nelts; i++) {