mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 06:07:37 +03:00
mod_s2s, mod_saslauth, mod_compression: Refactor to have common code for opening streams
This commit is contained in:
parent
c9d9694da0
commit
ee9ef878c4
4 changed files with 28 additions and 22 deletions
|
@ -141,10 +141,7 @@ module:hook("stanza/http://jabber.org/protocol/compress:compressed", function(ev
|
|||
-- setup decompression for session.data
|
||||
setup_decompression(session, inflate_stream);
|
||||
session:reset_stream();
|
||||
local default_stream_attr = {xmlns = "jabber:server", ["xmlns:stream"] = "http://etherx.jabber.org/streams",
|
||||
["xmlns:db"] = 'jabber:server:dialback', version = "1.0", to = session.to_host, from = session.from_host};
|
||||
session.sends2s("<?xml version='1.0'?>");
|
||||
session.sends2s(st.stanza("stream:stream", default_stream_attr):top_tag());
|
||||
session:open_stream();
|
||||
session.compressed = true;
|
||||
return true;
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue