s2smanager: Fix for the logic SRV record priority comparison (thanks darkrain)

Thu, 25 Feb 2010 17:52:33 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 25 Feb 2010 17:52:33 +0000
changeset 2711
5d97fb043141
parent 2710
1600aff0839f
child 2712
9c579864b20a

s2smanager: Fix for the logic SRV record priority comparison (thanks darkrain)

core/s2smanager.lua file | annotate | diff | comparison | revisions
--- a/core/s2smanager.lua	Wed Jan 20 02:44:38 2010 +0000
+++ b/core/s2smanager.lua	Thu Feb 25 17:52:33 2010 +0000
@@ -50,7 +50,9 @@
 
 module "s2smanager"
 
-local function compare_srv_priorities(a,b) return a.priority < b.priority or a.weight < b.weight; end
+function compare_srv_priorities(a,b)
+	return a.priority < b.priority or (a.priority == b.priority and a.weight > b.weight);
+end
 
 local function bounce_sendq(session)
 	local sendq = session.sendq;

mercurial