Software /
code /
prosody
Comparison
plugins/mod_csi_simple.lua @ 10831:7dd7cdb43181
mod_csi_simple: Identify raw string data in logging and stats
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 10 May 2020 23:06:21 +0200 |
parent | 10830:8889d5037aca |
child | 10832:7395f6e68dba |
comparison
equal
deleted
inserted
replaced
10830:8889d5037aca | 10831:7dd7cdb43181 |
---|---|
14 local queue_size = module:get_option_number("csi_queue_size", 256); | 14 local queue_size = module:get_option_number("csi_queue_size", 256); |
15 | 15 |
16 local important_payloads = module:get_option_set("csi_important_payloads", { }); | 16 local important_payloads = module:get_option_set("csi_important_payloads", { }); |
17 | 17 |
18 function is_important(stanza) --> boolean, reason: string | 18 function is_important(stanza) --> boolean, reason: string |
19 if not st.is_stanza(stanza) then | 19 if type(stanza) == "string" then |
20 -- whitespace pings etc | 20 -- whitespace pings etc |
21 return true, "raw data"; | |
22 elseif not st.is_stanza(stanza) then | |
21 return true; | 23 return true; |
22 end | 24 end |
23 if stanza.attr.xmlns ~= nil then | 25 if stanza.attr.xmlns ~= nil then |
24 -- stream errors, stream management etc | 26 -- stream errors, stream management etc |
25 return true, "nonza"; | 27 return true, "nonza"; |