# HG changeset patch # User Kim Alvefur # Date 1326987484 -3600 # Node ID 187ce118aea60b598f98808992dbe84441bf099c # Parent d1ddfc4709ce74ef24fe40256f98c42ded9a95a9 mod_compression: Use get_option_number diff -r d1ddfc4709ce -r 187ce118aea6 plugins/mod_compression.lua --- a/plugins/mod_compression.lua Wed Jan 18 15:08:05 2012 +0000 +++ b/plugins/mod_compression.lua Thu Jan 19 16:38:04 2012 +0100 @@ -16,12 +16,8 @@ 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.");