mirror of
https://github.com/bjc/prosody.git
synced 2025-04-07 07:07:38 +03:00
mod_s2s, s2sout.lib: Send stream header in onconnect()
This commit is contained in:
parent
6e38fa6d6b
commit
81cbf8c7d4
2 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -314,8 +314,6 @@ function s2sout.make_connect(host_session, connect_host, connect_port)
|
|||
-- otherwise it will assume it is a new incoming connection
|
||||
s2s_listener.register_outgoing(conn, host_session);
|
||||
|
||||
host_session:open_stream(from_host, to_host);
|
||||
|
||||
log("debug", "Connection attempt in progress...");
|
||||
return true;
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue