Comparison

plugins/mod_compression.lua @ 4481:408c2f688e4e

mod_compression: Change default compression level to 7
author Kim Alvefur <zash@zash.se>
date Thu, 19 Jan 2012 16:47:12 +0100
parent 4480:187ce118aea6
child 4898:010c01841ed0
comparison
equal deleted inserted replaced
4480:187ce118aea6 4481:408c2f688e4e
14 local xmlns_compression_protocol = "http://jabber.org/protocol/compress" 14 local xmlns_compression_protocol = "http://jabber.org/protocol/compress"
15 local xmlns_stream = "http://etherx.jabber.org/streams"; 15 local xmlns_stream = "http://etherx.jabber.org/streams";
16 local compression_stream_feature = st.stanza("compression", {xmlns=xmlns_compression_feature}):tag("method"):text("zlib"):up(); 16 local compression_stream_feature = st.stanza("compression", {xmlns=xmlns_compression_feature}):tag("method"):text("zlib"):up();
17 local add_filter = require "util.filters".add_filter; 17 local add_filter = require "util.filters".add_filter;
18 18
19 local compression_level = module:get_option_number("compression_level", 9); 19 local compression_level = module:get_option_number("compression_level", 7);
20 20
21 if not compression_level or compression_level < 1 or compression_level > 9 then 21 if not compression_level or compression_level < 1 or compression_level > 9 then
22 module:log("warn", "Invalid compression level in config: %s", tostring(compression_level)); 22 module:log("warn", "Invalid compression level in config: %s", tostring(compression_level));
23 module:log("warn", "Module loading aborted. Compression won't be available."); 23 module:log("warn", "Module loading aborted. Compression won't be available.");
24 return; 24 return;