mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 05:37:39 +03:00
mod_csi_simple: Try not to flush buffer while already flushing it
Reduces log noice
This commit is contained in:
parent
72b4209cfb
commit
1356b90c3a
1 changed files with 5 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue