Changeset

2714:9c5d8e0c146e

Merge with 0.6
author Matthew Wild <mwild1@gmail.com>
date Thu, 25 Feb 2010 18:03:15 +0000
parents 2708:d9c4ade80ae9 (current diff) 2713:1fc95582d74b (diff)
children 2715:5e7eac7c1bda 2716:4e4a24a1288d
files core/s2smanager.lua net/adns.lua
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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