aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-06 23:43:48 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-06 23:43:48 +0100
commit12c59fd50ce83f4c16184c9802d40626843cc48e (patch)
treee639b6e06055dc460bb1dd768f8d3f2a95d0816f /core/s2smanager.lua
parenta27b83955118295304b593d0f7874958b57d610a (diff)
downloadprosody-12c59fd50ce83f4c16184c9802d40626843cc48e.tar.gz
prosody-12c59fd50ce83f4c16184c9802d40626843cc48e.zip
core.s2smanager: Check for valid host and port before attempting connection
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 4c758159..158536d8 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -177,6 +177,11 @@ function attempt_connection(host_session, err)
return false;
end
+ if not (connect_host and connect_port) then
+ -- Likely we couldn't resolve DNS
+ return false;
+ end
+
-- Ok, we're going to try to connect
conn:settimeout(0);
local success, err = conn:connect(connect_host, connect_port);