aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_compression.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-03-03 22:05:05 +0000
committerMatthew Wild <mwild1@gmail.com>2010-03-03 22:05:05 +0000
commit8862e1b27eb767c99a068d13bd15c77c2c9e1471 (patch)
tree067f338a5f8e31a6b1fb6ca706562a044af80024 /plugins/mod_compression.lua
parent87ff54c75266ffa37f716d1c7a542e956bbe54b3 (diff)
parent5d9b9b6b30f06a3e3aa957279357dd42ae19ddf4 (diff)
downloadprosody-8862e1b27eb767c99a068d13bd15c77c2c9e1471.tar.gz
prosody-8862e1b27eb767c99a068d13bd15c77c2c9e1471.zip
Merge 0.6.2/waqas with 0.6.2/MattJ
Diffstat (limited to 'plugins/mod_compression.lua')
-rw-r--r--plugins/mod_compression.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index f1cae737..ec9e24ec 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -14,10 +14,10 @@ local xmlns_compression_protocol = "http://jabber.org/protocol/compress"
local compression_stream_feature = st.stanza("compression", {xmlns=xmlns_compression_feature}):tag("method"):text("zlib"):up();
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;
+
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));
@@ -41,7 +41,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
if session.compressed then
local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method");
session.send(error_st);
- session:log("warn", "Tried to establish another compression layer.");
+ session.log("warn", "Tried to establish another compression layer.");
end
-- checking if the compression method is supported
@@ -56,7 +56,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
if status == false then
local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("setup-failed");
session.send(error_st);
- session:log("error", "Failed to create zlib.deflate filter.");
+ session.log("error", "Failed to create zlib.deflate filter.");
module:log("error", deflate_stream);
return
end
@@ -65,7 +65,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
if status == false then
local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("setup-failed");
session.send(error_st);
- session:log("error", "Failed to create zlib.deflate filter.");
+ session.log("error", "Failed to create zlib.deflate filter.");
module:log("error", inflate_stream);
return
end