aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_compression.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-03-09 17:43:18 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-03-09 17:43:18 +0500
commitcf224cd1a1f08dcf6ba48253fd60a2d148c613b3 (patch)
tree1c0bd9a7d0e2cd6eb4f0f85b054ad79a24ee2cee /plugins/mod_compression.lua
parent8862e1b27eb767c99a068d13bd15c77c2c9e1471 (diff)
downloadprosody-cf224cd1a1f08dcf6ba48253fd60a2d148c613b3.tar.gz
prosody-cf224cd1a1f08dcf6ba48253fd60a2d148c613b3.zip
mod_compression: Fixed various possible tracebacks in logging.
Diffstat (limited to 'plugins/mod_compression.lua')
-rw-r--r--plugins/mod_compression.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index ec9e24ec..9ad0cbd4 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -8,6 +8,7 @@
local st = require "util.stanza";
local zlib = require "zlib";
local pcall = pcall;
+local tostring = tostring;
local xmlns_compression_feature = "http://jabber.org/features/compress"
local xmlns_compression_protocol = "http://jabber.org/protocol/compress"
@@ -57,7 +58,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
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.");
- module:log("error", deflate_stream);
+ module:log("error", "%s", tostring(deflate_stream));
return
end
@@ -65,8 +66,8 @@ 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.");
- module:log("error", inflate_stream);
+ session.log("error", "Failed to create zlib.inflate filter.");
+ module:log("error", "%s", tostring(inflate_stream));
return
end
@@ -81,7 +82,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
text = compressed;
extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed");
});
- module:log("warn", compressed);
+ module:log("warn", "%s", tostring(compressed));
return;
end
old_send(compressed);
@@ -98,7 +99,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
text = decompressed;
extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed");
});
- module:log("warn", decompressed);
+ module:log("warn", "%s", tostring(decompressed));
return;
end
old_data(conn, decompressed);
@@ -114,7 +115,7 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc
end;
session.compressed = true;
else
- session.log("info", method.." compression selected. But we don't support it.");
+ session.log("info", "%s compression selected, but we don't support it.", tostring(method));
local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method");
session.send(error_st);
end