aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-05 16:50:41 +0200
committerKim Alvefur <zash@zash.se>2019-10-05 16:50:41 +0200
commit1356b90c3a135009a5b6ba5c56b2f4a407f7fc3a (patch)
tree8465e1e82803f289670349fa262368c253f1295d
parent72b4209cfb6968802358cf5556dfb7be6442e194 (diff)
downloadprosody-1356b90c3a135009a5b6ba5c56b2f4a407f7fc3a.tar.gz
prosody-1356b90c3a135009a5b6ba5c56b2f4a407f7fc3a.zip
mod_csi_simple: Try not to flush buffer while already flushing it
Reduces log noice
-rw-r--r--plugins/mod_csi_simple.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 4e2b95e1..b99aaab3 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -75,6 +75,10 @@ local function manage_buffer(stanza, session)
end
local function flush_buffer(data, session)
+ if session.csi_flushing then
+ return data;
+ end
+ session.csi_flushing = true;
session.log("debug", "Client sent something, flushing buffer once (queue size is %d)", session.csi_counter);
session.conn:resume_writes();
return data;
@@ -92,6 +96,7 @@ end
function disable_optimizations(session)
if session.conn and session.conn.resume_writes then
+ session.csi_flushing = nil;
filters.remove_filter(session, "stanzas/out", manage_buffer);
filters.remove_filter(session, "bytes/in", flush_buffer);
session.conn:resume_writes();