aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-24 04:57:17 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-24 04:57:17 +0000
commit8bacb473e3e5ed144a1bbe6b65228cb7d79440eb (patch)
tree276c743c4ad97487e622f3820cb88b58a0856578 /core/s2smanager.lua
parent1f94e008896068e42f26f933fd5cf10cfc74f546 (diff)
downloadprosody-8bacb473e3e5ed144a1bbe6b65228cb7d79440eb.tar.gz
prosody-8bacb473e3e5ed144a1bbe6b65228cb7d79440eb.zip
s2smanager: Handle DNS lookup error in response handler
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 2f561070..58bd73d1 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -288,7 +288,7 @@ end
function try_connect(host_session, connect_host, connect_port)
host_session.connecting = true;
local handle;
- handle = adns.lookup(function (reply)
+ handle = adns.lookup(function (reply, err)
handle = nil;
host_session.connecting = nil;
@@ -311,7 +311,8 @@ function try_connect(host_session, connect_host, connect_port)
log("debug", "DNS lookup failed to get a response for %s", connect_host);
if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can
log("debug", "No other records to try for %s - destroying", host_session.to_host);
- destroy_session(host_session, "DNS resolution failed"); -- End of the line, we can't
+ err = err and (": "..err) or "";
+ destroy_session(host_session, "DNS resolution failed"..err); -- End of the line, we can't
end
end
end, connect_host, "A", "IN");