Software /
code /
prosody
Changeset
2090:7810648ea26d
s2smanager: Fail outgoing s2s connection if hostname does not pass idna_to_ascii(), thanks Flo + waqas
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 20 Nov 2009 15:07:39 +0000 |
parents | 2089:fdd7280c4621 |
children | 2091:6fd686a45806 2139:625b2d3e8900 2156:a6608ccab383 2279:49bc4c7bdef8 |
files | core/s2smanager.lua |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/core/s2smanager.lua Fri Nov 20 04:39:54 2009 +0000 +++ b/core/s2smanager.lua Fri Nov 20 15:07:39 2009 +0000 @@ -106,6 +106,7 @@ else log("debug", "opening a new outgoing connection for this stanza"); local host_session = new_outgoing(from_host, to_host); + -- Store in buffer host_session.sendq = { {tostring(data), st.reply(data)} }; log("debug", "stanza [%s] queued until connection complete", tostring(data.name)); @@ -155,7 +156,7 @@ host_session.log = log; end - -- This is the first call, can't fail (the first step is DNS lookup) + -- Kick the connection attempting machine attempt_connection(host_session); if not host_session.sends2s then @@ -183,6 +184,10 @@ local from_host, to_host = host_session.from_host, host_session.to_host; local connect_host, connect_port = idna_to_ascii(to_host), 5269; + if not connect_host then + return false; + end + if not err then -- This is our first attempt log("debug", "First attempt to connect to %s, starting with SRV lookup...", to_host); host_session.connecting = true;