Diff

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
line wrap: on
line diff
--- a/plugins/mod_csi_simple.lua	Sun May 10 23:06:21 2020 +0200
+++ b/plugins/mod_csi_simple.lua	Sun May 10 23:09:15 2020 +0200
@@ -16,8 +16,9 @@
 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;