# HG changeset patch # User Kim Alvefur # Date 1570287041 -7200 # Node ID 4c53e58d2468e529f54ae617baa2e7853eaf4717 # Parent 3123a13cf5776b59e860d2cf64f891f979339bf7 mod_csi_simple: Try not to flush buffer while already flushing it Reduces log noice diff -r 3123a13cf577 -r 4c53e58d2468 plugins/mod_csi_simple.lua --- a/plugins/mod_csi_simple.lua Sat Oct 05 16:21:41 2019 +0200 +++ b/plugins/mod_csi_simple.lua Sat Oct 05 16:50:41 2019 +0200 @@ -75,6 +75,10 @@ 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 @@ 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();