Comparison

plugins/mod_csi_simple.lua @ 10832:7395f6e68dba

mod_csi_simple: Report whitespace keepalives Single space character is sent by mod_c2s when a session has been silent for some time. This should account for the vast majority of raw strings passing through here. If this is not the case then having stats to say otherwise will be interesting.
author Kim Alvefur <zash@zash.se>
date Sun, 10 May 2020 23:09:15 +0200
parent 10831:7dd7cdb43181
child 10833:ac691f305ea7
comparison
equal deleted inserted replaced
10831:7dd7cdb43181 10832:7395f6e68dba
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 type(stanza) == "string" then 19 if stanza == " " then
20 -- whitespace pings etc 20 return true, "whitespace keepalive";
21 elseif type(stanza) == "string" then
21 return true, "raw data"; 22 return true, "raw data";
22 elseif not st.is_stanza(stanza) then 23 elseif not st.is_stanza(stanza) then
23 return true; 24 return true;
24 end 25 end
25 if stanza.attr.xmlns ~= nil then 26 if stanza.attr.xmlns ~= nil then