Thu, 25 Feb 2010 18:08:59 +0000
Merge with 0.7
--- a/core/s2smanager.lua Mon Feb 22 01:48:42 2010 +0000 +++ b/core/s2smanager.lua Thu Feb 25 18:08:59 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;
--- a/net/server_event.lua Mon Feb 22 01:48:42 2010 +0000 +++ b/net/server_event.lua Thu Feb 25 18:08:59 2010 +0000 @@ -281,6 +281,10 @@ self.nointerface, self.noreading, self.nowriting = nointerface, noreading, nowriting return nointerface, noreading, nowriting end + + function interface_mt:lock_read(switch) + return self:_lock(self.nointerface, switch, self.nowriting); + end function interface_mt:counter(c) if c then
--- a/tests/test_core_s2smanager.lua Mon Feb 22 01:48:42 2010 +0000 +++ b/tests/test_core_s2smanager.lua Thu Feb 25 18:08:59 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