changeset 4817:d794e59800ef

Mail: fixed sorting of listen addresses (ticket #187). For http module this problem was already fixed in r4756.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 17 Aug 2012 05:08:42 +0000
parents 2ccaaf838bc2
children 28a64967e891
files src/mail/ngx_mail.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -539,6 +539,11 @@ ngx_mail_cmp_conf_addrs(const void *one,
         return 1;
     }
 
+    if (second->wildcard) {
+        /* a wildcard must be the last resort, shift it to the end */
+        return -1;
+    }
+
     if (first->bind && !second->bind) {
         /* shift explicit bind()ed addresses to the start */
         return -1;