core.s2smanager: Check for valid host and port before attempting connection
authorMatthew Wild <mwild1@gmail.com>
Mon, 06 Apr 2009 23:43:48 +0100
changeset 960 6bc16062da6c
parent 959 e3db909065f2
child 961 b48ed2149d0a
core.s2smanager: Check for valid host and port before attempting connection
core/s2smanager.lua
--- a/core/s2smanager.lua	Sun Apr 05 20:06:39 2009 +0100
+++ b/core/s2smanager.lua	Mon Apr 06 23:43:48 2009 +0100
@@ -177,6 +177,11 @@
 		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);