Comparison

plugins/mod_compression.lua @ 5351:901ed253bbf7

mod_s2s, mod_saslauth, mod_compression: Refactor to have common code for opening streams
author Kim Alvefur <zash@zash.se>
date Sat, 16 Mar 2013 17:46:43 +0100
parent 4898:010c01841ed0
child 5535:0df0afc041d7
comparison
equal deleted inserted replaced
5350:fba042a2c228 5351:901ed253bbf7
139 setup_compression(session, deflate_stream); 139 setup_compression(session, deflate_stream);
140 140
141 -- setup decompression for session.data 141 -- setup decompression for session.data
142 setup_decompression(session, inflate_stream); 142 setup_decompression(session, inflate_stream);
143 session:reset_stream(); 143 session:reset_stream();
144 local default_stream_attr = {xmlns = "jabber:server", ["xmlns:stream"] = "http://etherx.jabber.org/streams", 144 session:open_stream();
145 ["xmlns:db"] = 'jabber:server:dialback', version = "1.0", to = session.to_host, from = session.from_host};
146 session.sends2s("<?xml version='1.0'?>");
147 session.sends2s(st.stanza("stream:stream", default_stream_attr):top_tag());
148 session.compressed = true; 145 session.compressed = true;
149 return true; 146 return true;
150 end 147 end
151 end); 148 end);
152 149