aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-16 13:37:18 +0100
committerKim Alvefur <zash@zash.se>2021-11-16 13:37:18 +0100
commit49e86e78c527c25b1fa195c2a4dd22b9bca222ca (patch)
tree4ae3b0fba280c2a86277cd4e65a69fc37434b0b5
parenteecabd740d752249e6e731e2660ad5053caba431 (diff)
downloadprosody-49e86e78c527c25b1fa195c2a4dd22b9bca222ca.tar.gz
prosody-49e86e78c527c25b1fa195c2a4dd22b9bca222ca.zip
mod_csi_simple: Unlock writes after event, to allow things to be queued
E.g. mod_smacks could queue an <r>, which would be more likely to be included in the same write and TCP segment as the previously buffered data, reducing syscalls and network packets needing to be sent.
-rw-r--r--plugins/mod_csi_simple.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 74fae4c8..a3e08264 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -124,9 +124,9 @@ local function manage_buffer(stanza, session)
end
flush_reasons:with_labels(why or "important"):add(1);
session.log("debug", "Flushing buffer (%s; queue size is %d)", why or "important", session.csi_counter);
- session.conn:resume_writes();
session.state = "flushing";
module:fire_event("csi-flushing", { session = session });
+ session.conn:resume_writes();
else
session.log("debug", "Holding buffer (%s; queue size is %d)", why or "unimportant", session.csi_counter);
stanza = with_timestamp(stanza, jid.join(session.username, session.host))