Software /
code /
prosody
Comparison
plugins/mod_compression.lua @ 2324:9f7eb1054a2f
mod_compression: Tweak some log levels
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 04 Dec 2009 19:04:03 +0000 |
parent | 2293:abd28ed5d8b0 |
child | 2609:2ee28cae530a |
comparison
equal
deleted
inserted
replaced
2323:b7f683c55a44 | 2324:9f7eb1054a2f |
---|---|
175 end | 175 end |
176 | 176 |
177 -- checking if the compression method is supported | 177 -- checking if the compression method is supported |
178 local method = stanza:child_with_name("method")[1]; | 178 local method = stanza:child_with_name("method")[1]; |
179 if method == "zlib" then | 179 if method == "zlib" then |
180 session.log("info", method.." compression selected."); | 180 session.log("debug", method.." compression selected."); |
181 | 181 |
182 -- create deflate and inflate streams | 182 -- create deflate and inflate streams |
183 local deflate_stream = get_deflate_stream(session); | 183 local deflate_stream = get_deflate_stream(session); |
184 if not deflate_stream then return end | 184 if not deflate_stream then return end |
185 | 185 |
201 setup_decompression(session, inflate_stream); | 201 setup_decompression(session, inflate_stream); |
202 return true; | 202 return true; |
203 end; | 203 end; |
204 session.compressed = true; | 204 session.compressed = true; |
205 else | 205 else |
206 session.log("info", method.." compression selected. But we don't support it."); | 206 session.log("warn", method.." compression selected. But we don't support it."); |
207 local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method"); | 207 local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method"); |
208 (session.sends2s or session.send)(error_st); | 208 (session.sends2s or session.send)(error_st); |
209 end | 209 end |
210 end | 210 end |
211 ); | 211 ); |