Software /
code /
prosody
Changeset
4480:187ce118aea6
mod_compression: Use get_option_number
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 19 Jan 2012 16:38:04 +0100 |
parents | 4479:d1ddfc4709ce |
children | 4481:408c2f688e4e |
files | plugins/mod_compression.lua |
diffstat | 1 files changed, 1 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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.");