aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/s2sout.lib.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-07-22 16:17:33 +0100
committerMatthew Wild <mwild1@gmail.com>2012-07-22 16:17:33 +0100
commit92d6725339ce0233dffd2ecde606d684d05d4c93 (patch)
tree3f4c5a37a35c5475e37d19488151321c526daa8c /plugins/mod_s2s/s2sout.lib.lua
parent8ff644f2d3ae1e860396b211d9185a640f96cd73 (diff)
parentfb3b789dca8a2cf050dad7a7bd445d4789eaabea (diff)
downloadprosody-92d6725339ce0233dffd2ecde606d684d05d4c93.tar.gz
prosody-92d6725339ce0233dffd2ecde606d684d05d4c93.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_s2s/s2sout.lib.lua')
-rw-r--r--plugins/mod_s2s/s2sout.lib.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/mod_s2s/s2sout.lib.lua b/plugins/mod_s2s/s2sout.lib.lua
index 48a49036..6e1eb3d7 100644
--- a/plugins/mod_s2s/s2sout.lib.lua
+++ b/plugins/mod_s2s/s2sout.lib.lua
@@ -170,7 +170,7 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err)
local IPs = {};
host_session.ip_hosts = IPs;
local handle4, handle6;
- local has_other = false;
+ local have_other_result = not(has_ipv4) or not(has_ipv6) or false;
if has_ipv4 then
handle4 = adns.lookup(function (reply, err)
@@ -195,7 +195,7 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err)
end
end
- if has_other then
+ if have_other_result then
if #IPs > 0 then
rfc3484_dest(host_session.ip_hosts, sources);
for i = 1, #IPs do
@@ -213,11 +213,11 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err)
end
end
else
- has_other = true;
+ have_other_result = true;
end
end, connect_host, "A", "IN");
else
- has_other = true;
+ have_other_result = true;
end
if has_ipv6 then
@@ -231,7 +231,7 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err)
end
end
- if has_other then
+ if have_other_result then
if #IPs > 0 then
rfc3484_dest(host_session.ip_hosts, sources);
for i = 1, #IPs do
@@ -249,13 +249,12 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err)
end
end
else
- has_other = true;
+ have_other_result = true;
end
end, connect_host, "AAAA", "IN");
else
- has_other = true;
+ have_other_result = true;
end
-
return true;
elseif host_session.ip_hosts and #host_session.ip_hosts > host_session.ip_choice then -- Not our first attempt, and we also have IPs left to try
s2sout.try_next_ip(host_session);