[nginx] svn commit: r4814 - trunk/src/mail

ru at nginx.com ru at nginx.com
Wed Aug 15 11:30:25 UTC 2012


Author: ru
Date: 2012-08-15 11:30:24 +0000 (Wed, 15 Aug 2012)
New Revision: 4814
URL: http://trac.nginx.org/nginx/changeset/4814/nginx

Log:
mail_core: don't let the well-known port in the "listen" directive to
override the already set "protocol".


Modified:
   trunk/src/mail/ngx_mail_core_module.c

Modified: trunk/src/mail/ngx_mail_core_module.c
===================================================================
--- trunk/src/mail/ngx_mail_core_module.c	2012-08-15 11:17:55 UTC (rev 4813)
+++ trunk/src/mail/ngx_mail_core_module.c	2012-08-15 11:30:24 UTC (rev 4814)
@@ -378,22 +378,24 @@
     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;
+                }
+            }
         }
     }
 



More information about the nginx-devel mailing list