Changeset

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
parents 10831:7dd7cdb43181
children 10833:ac691f305ea7
files plugins/mod_csi_simple.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
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;