diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-02-25 18:08:59 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-02-25 18:08:59 +0000 |
commit | e224080a1416a55366b82243eb1fa92052f096fc (patch) | |
tree | 694651bed0dd85190842359c60cb71eb006723ef | |
parent | 2113d0d2552f174a2f86789323ac0c10d3d1e210 (diff) | |
parent | 52d66e52676c48d453fa286be2c5587dce80afb4 (diff) | |
download | prosody-e224080a1416a55366b82243eb1fa92052f096fc.tar.gz prosody-e224080a1416a55366b82243eb1fa92052f096fc.zip |
Merge with 0.7
-rw-r--r-- | core/s2smanager.lua | 4 | ||||
-rw-r--r-- | net/server_event.lua | 4 | ||||
-rw-r--r-- | tests/test_core_s2smanager.lua | 8 |
3 files changed, 11 insertions, 5 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 875a6bdc..16ede7b6 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -48,7 +48,9 @@ local incoming_s2s = incoming_s2s; 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 --git a/net/server_event.lua b/net/server_event.lua index 3456fb9e..d041ae43 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -281,6 +281,10 @@ do 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 diff --git a/tests/test_core_s2smanager.lua b/tests/test_core_s2smanager.lua index 8635ed24..6a7ebcd0 100644 --- a/tests/test_core_s2smanager.lua +++ b/tests/test_core_s2smanager.lua @@ -30,18 +30,18 @@ function compare_srv_priorities(csp) 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 |