diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-05-24 03:08:42 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-05-24 03:08:42 +0100 |
commit | 81cbf8c7d43374558c12664da8cf4207abdb0c6b (patch) | |
tree | cc31fb5c6a6b4518f87f3b1524af3ec7471dd23b /plugins/mod_s2s/mod_s2s.lua | |
parent | 6e38fa6d6b095c5fd384801240f4e941f70fedb9 (diff) | |
download | prosody-81cbf8c7d43374558c12664da8cf4207abdb0c6b.tar.gz prosody-81cbf8c7d43374558c12664da8cf4207abdb0c6b.zip |
mod_s2s, s2sout.lib: Send stream header in onconnect()
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index 8e01a589..f6c20606 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -427,8 +427,9 @@ local function initialize_session(session) end function listener.onconnect(conn) - if not sessions[conn] then -- May be an existing outgoing session - local session = s2s_new_incoming(conn); + local session = sessions[conn]; + if not session then -- New incoming connection + session = s2s_new_incoming(conn); sessions[conn] = session; session.log("debug", "Incoming s2s connection"); @@ -448,6 +449,8 @@ function listener.onconnect(conn) end initialize_session(session); + else -- Outgoing session connected + session:open_stream(session.from_host, session.to_host); end end |