# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1239057828 -3600
# Node ID 6bc16062da6cfac3db7354ce9d63e6f7c234569c
# Parent  e3db909065f239d75912115dc5f9bf3d2a829178
core.s2smanager: Check for valid host and port before attempting connection

diff -r e3db909065f2 -r 6bc16062da6c 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);