aboutsummaryrefslogtreecommitdiffstats
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
commitec15ee49795f6adde327b1731dcea6ec894346b8 (patch)
tree7d36fb5734e0f092eea0ba92592c4fa2412e5d85
parent0f27eda0d6c669de07363fdbb50648b5749b2a21 (diff)
downloadprosody-ec15ee49795f6adde327b1731dcea6ec894346b8.tar.gz
prosody-ec15ee49795f6adde327b1731dcea6ec894346b8.zip
s2smanager: Handle DNS lookup error in response handler
-rw-r--r--core/s2smanager.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index cd381308..dc0bf3d9 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -287,7 +287,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;
@@ -310,7 +310,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");