Changeset

960:6bc16062da6c

core.s2smanager: Check for valid host and port before attempting connection
author Matthew Wild <mwild1@gmail.com>
date Mon, 06 Apr 2009 23:43:48 +0100
parents 959:e3db909065f2
children 961:b48ed2149d0a
files core/s2smanager.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);