Changeset

11919:fae5441fc6cf

mod_csi_simple: Skip flushing of empty buffer Just adds noise
author Kim Alvefur <zash@zash.se>
date Thu, 18 Nov 2021 01:57:21 +0100
parents 11918:2dc3bc5e137a
children 11920:ff4e34c448a4
files plugins/mod_csi_simple.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_csi_simple.lua	Thu Nov 18 00:39:10 2021 +0100
+++ b/plugins/mod_csi_simple.lua	Thu Nov 18 01:57:21 2021 +0100
@@ -140,6 +140,8 @@
 end
 
 local function flush_buffer(data, session)
+	local ctr = session.csi_counter or 0;
+	if ctr == 0 then return data end
 	session.log("debug", "Flushing buffer (%s; queue size is %d)", "client activity", session.csi_counter);
 	session.state = "flushing";
 	module:fire_event("csi-flushing", { session = session });