Software /
code /
prosody
Diff
core/s2smanager.lua @ 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 |
parent | 959:e3db909065f2 |
child | 963:43b140edfd84 |
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);