diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-26 23:44:30 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-26 23:44:30 +0000 |
commit | fba46bce304eeeec0e3eedf9792dc071c2f39f85 (patch) | |
tree | 5de9875e75179403de891672b4ac8d963e6a81cc /net | |
parent | a7cac3b9535ad919522f7858143b993c2f469446 (diff) | |
download | prosody-fba46bce304eeeec0e3eedf9792dc071c2f39f85.tar.gz prosody-fba46bce304eeeec0e3eedf9792dc071c2f39f85.zip |
(Basic) IDNA and SRV fallback support
Diffstat (limited to 'net')
-rw-r--r-- | net/xmppserver_listener.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua index 15ce0b23..cd9a3460 100644 --- a/net/xmppserver_listener.lua +++ b/net/xmppserver_listener.lua @@ -7,7 +7,7 @@ local s2s_new_incoming = require "core.s2smanager".new_incoming; local s2s_streamopened = require "core.s2smanager".streamopened; local s2s_streamclosed = require "core.s2smanager".streamclosed; local s2s_destroy_session = require "core.s2smanager".destroy_session; - +local s2s_attempt_connect = require "core.s2smanager".attempt_connection; local stream_callbacks = { streamopened = s2s_streamopened, streamclosed = s2s_streamclosed }; local connlisteners_register = require "net.connlisteners".register; @@ -109,10 +109,15 @@ function xmppserver.listener(conn, data) end end -function xmppserver.disconnect(conn) +function xmppserver.disconnect(conn, err) local session = sessions[conn]; if session then - (session.log or log)("info", "s2s disconnected: %s->%s", tostring(session.from_host), tostring(session.to_host)); + if err and err ~= "closed" and session.srv_hosts then + if s2s_attempt_connect(session, err) then + return; -- Session lives for now + end + end + (session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err)); s2s_destroy_session(session); sessions[conn] = nil; session = nil; |