Software / code / verse
Comparison
plugins/compression.lua @ 176:6004486e8b6c
plugins.disco,compression: Use xmlns_* variables
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 31 Dec 2010 01:10:57 +0100 |
| parent | 79:da06d4996992 |
| child | 197:7e98cf2c1d8d |
comparison
equal
deleted
inserted
replaced
| 175:4d2a5d02fdfa | 176:6004486e8b6c |
|---|---|
| 45 local status, compressed, eof = pcall(deflate_stream, tostring(t), 'sync'); | 45 local status, compressed, eof = pcall(deflate_stream, tostring(t), 'sync'); |
| 46 if status == false then | 46 if status == false then |
| 47 session:close({ | 47 session:close({ |
| 48 condition = "undefined-condition"; | 48 condition = "undefined-condition"; |
| 49 text = compressed; | 49 text = compressed; |
| 50 extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed"); | 50 extra = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("processing-failed"); |
| 51 }); | 51 }); |
| 52 session:warn("Compressed send failed: %s", tostring(compressed)); | 52 session:warn("Compressed send failed: %s", tostring(compressed)); |
| 53 return; | 53 return; |
| 54 end | 54 end |
| 55 session.conn:write(compressed); | 55 session.conn:write(compressed); |
| 64 local status, decompressed, eof = pcall(inflate_stream, data); | 64 local status, decompressed, eof = pcall(inflate_stream, data); |
| 65 if status == false then | 65 if status == false then |
| 66 session:close({ | 66 session:close({ |
| 67 condition = "undefined-condition"; | 67 condition = "undefined-condition"; |
| 68 text = decompressed; | 68 text = decompressed; |
| 69 extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed"); | 69 extra = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("processing-failed"); |
| 70 }); | 70 }); |
| 71 stream:warn("%s", tostring(decompressed)); | 71 stream:warn("%s", tostring(decompressed)); |
| 72 return; | 72 return; |
| 73 end | 73 end |
| 74 return old_data(conn, decompressed); | 74 return old_data(conn, decompressed); |