diff options
author | Kim Alvefur <zash@zash.se> | 2020-05-10 23:09:15 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-05-10 23:09:15 +0200 |
commit | c34f2c9ebf519ae400018cb81bb0d8141d75af64 (patch) | |
tree | aecebd5d4c1741ebc2b65d200a3a556442f8caac /plugins | |
parent | 9b7ab06ef37d1271d76f2ef9cba6b8f72af199ce (diff) | |
download | prosody-c34f2c9ebf519ae400018cb81bb0d8141d75af64.tar.gz prosody-c34f2c9ebf519ae400018cb81bb0d8141d75af64.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.lua | 5 |
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; |