From: Ruslan Ermilov Date: Fri, 17 Aug 2012 05:08:42 +0000 (+0000) Subject: Mail: fixed sorting of listen addresses (ticket #187). X-Git-Tag: release-1.3.5~7 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=f12c7563e2523e268075bb1acc254ea30d536840;p=nginx.git Mail: fixed sorting of listen addresses (ticket #187). For http module this problem was already fixed in r4756. --- diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c index 49ec2e05b..b097778db 100644 --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -539,6 +539,11 @@ ngx_mail_cmp_conf_addrs(const void *one, const void *two) 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;