# HG changeset patch # User Matthew Wild # Date 1267120995 0 # Node ID 9c5d8e0c146e25016fdb7c2d7c70bcdbafa9ff19 # Parent d9c4ade80ae9ae9750290cf9c5babe4412c7b906# Parent 1fc95582d74b59d04f0c22f0b7fbec6f7316de4f Merge with 0.6 diff -r d9c4ade80ae9 -r 9c5d8e0c146e core/s2smanager.lua --- a/core/s2smanager.lua Thu Feb 25 02:01:00 2010 +0000 +++ b/core/s2smanager.lua Thu Feb 25 18:03:15 2010 +0000 @@ -48,7 +48,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, reason) local sendq = session.sendq; diff -r d9c4ade80ae9 -r 9c5d8e0c146e net/adns.lua diff -r d9c4ade80ae9 -r 9c5d8e0c146e tests/test_core_s2smanager.lua --- a/tests/test_core_s2smanager.lua Thu Feb 25 02:01:00 2010 +0000 +++ b/tests/test_core_s2smanager.lua Thu Feb 25 18:03:15 2010 +0000 @@ -30,18 +30,18 @@ assert_equal(csp(r3, r2), false); assert_equal(csp(r3, r3), false); assert_equal(csp(r3, r4), false); - assert_equal(csp(r3, r5), true); + assert_equal(csp(r3, r5), false); assert_equal(csp(r4, r1), false); assert_equal(csp(r4, r2), false); assert_equal(csp(r4, r3), false); assert_equal(csp(r4, r4), false); - assert_equal(csp(r4, r5), true); + assert_equal(csp(r4, r5), false); assert_equal(csp(r5, r1), false); assert_equal(csp(r5, r2), false); - assert_equal(csp(r5, r3), false); - assert_equal(csp(r5, r4), false); + assert_equal(csp(r5, r3), true); + assert_equal(csp(r5, r4), true); assert_equal(csp(r5, r5), false); end