From dabccd65ac4cf3da3b241434d83e026df5d5bfdc Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 19 Jan 2012 16:38:04 +0100 Subject: mod_compression: Use get_option_number --- plugins/mod_compression.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'plugins/mod_compression.lua') diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index 82403016..b5031d72 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -16,12 +16,8 @@ local xmlns_stream = "http://etherx.jabber.org/streams"; local compression_stream_feature = st.stanza("compression", {xmlns=xmlns_compression_feature}):tag("method"):text("zlib"):up(); local add_filter = require "util.filters".add_filter; -local compression_level = module:get_option("compression_level"); --- if not defined assume admin wants best compression -if compression_level == nil then compression_level = 9 end; +local compression_level = module:get_option_number("compression_level", 9); - -compression_level = tonumber(compression_level); if not compression_level or compression_level < 1 or compression_level > 9 then module:log("warn", "Invalid compression level in config: %s", tostring(compression_level)); module:log("warn", "Module loading aborted. Compression won't be available."); -- cgit v1.2.3 From 3d9ca327ce10f2bb4d5af85c1695fe70dcf6dbe3 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 19 Jan 2012 16:47:12 +0100 Subject: mod_compression: Change default compression level to 7 --- plugins/mod_compression.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_compression.lua') diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index b5031d72..62c0fa2e 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -16,7 +16,7 @@ local xmlns_stream = "http://etherx.jabber.org/streams"; local compression_stream_feature = st.stanza("compression", {xmlns=xmlns_compression_feature}):tag("method"):text("zlib"):up(); local add_filter = require "util.filters".add_filter; -local compression_level = module:get_option_number("compression_level", 9); +local compression_level = module:get_option_number("compression_level", 7); if not compression_level or compression_level < 1 or compression_level > 9 then module:log("warn", "Invalid compression level in config: %s", tostring(compression_level)); -- cgit v1.2.3