Software /
code /
prosody
Comparison
plugins/mod_compression.lua @ 2884:6807f5fa0eb4
mod_compression: Don't succeed after indicating a failure.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 09 Mar 2010 18:11:45 +0500 |
parent | 2883:adbca5af8536 |
child | 2885:ae72c0dd6f1f |
comparison
equal
deleted
inserted
replaced
2883:adbca5af8536 | 2884:6807f5fa0eb4 |
---|---|
41 -- fail if we are already compressed | 41 -- fail if we are already compressed |
42 if session.compressed then | 42 if session.compressed then |
43 local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method"); | 43 local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method"); |
44 session.send(error_st); | 44 session.send(error_st); |
45 session.log("warn", "Tried to establish another compression layer."); | 45 session.log("warn", "Tried to establish another compression layer."); |
46 return; | |
46 end | 47 end |
47 | 48 |
48 -- checking if the compression method is supported | 49 -- checking if the compression method is supported |
49 local method = stanza:child_with_name("method")[1]; | 50 local method = stanza:child_with_name("method")[1]; |
50 if method == "zlib" then | 51 if method == "zlib" then |