aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-10 23:09:15 +0200
committerKim Alvefur <zash@zash.se>2020-05-10 23:09:15 +0200
commitd51e32b8d35443278d56a106e350f6f12458cd1f (patch)
treeaecebd5d4c1741ebc2b65d200a3a556442f8caac /plugins
parentaba0d80e94e48aba23f0c1de4137489fc7485bdb (diff)
downloadprosody-d51e32b8d35443278d56a106e350f6f12458cd1f.tar.gz
prosody-d51e32b8d35443278d56a106e350f6f12458cd1f.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_csi_simple.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 3f3271f0..679f9b48 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -16,8 +16,9 @@ local queue_size = module:get_option_number("csi_queue_size", 256);
local important_payloads = module:get_option_set("csi_important_payloads", { });
function is_important(stanza) --> boolean, reason: string
- if type(stanza) == "string" then
- -- whitespace pings etc
+ if stanza == " " then
+ return true, "whitespace keepalive";
+ elseif type(stanza) == "string" then
return true, "raw data";
elseif not st.is_stanza(stanza) then
return true;