Software /
code /
prosody
Comparison
plugins/mod_csi_simple.lua @ 11918:2dc3bc5e137a
mod_csi_simple: Fire event when flushing due to client activity
So that the same things happen as when triggered by an outgoing stanza
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Nov 2021 00:39:10 +0100 |
parent | 11916:5dae9262f81f |
child | 11919:fae5441fc6cf |
comparison
equal
deleted
inserted
replaced
11917:d27b74b25105 | 11918:2dc3bc5e137a |
---|---|
139 return stanza; | 139 return stanza; |
140 end | 140 end |
141 | 141 |
142 local function flush_buffer(data, session) | 142 local function flush_buffer(data, session) |
143 session.log("debug", "Flushing buffer (%s; queue size is %d)", "client activity", session.csi_counter); | 143 session.log("debug", "Flushing buffer (%s; queue size is %d)", "client activity", session.csi_counter); |
144 session.state = "flushing"; | |
145 module:fire_event("csi-flushing", { session = session }); | |
144 flush_reasons:with_labels("client activity"):add(1); | 146 flush_reasons:with_labels("client activity"):add(1); |
145 if session.csi_measure_buffer_hold then | 147 if session.csi_measure_buffer_hold then |
146 session.csi_measure_buffer_hold(); | 148 session.csi_measure_buffer_hold(); |
147 session.csi_measure_buffer_hold = nil; | 149 session.csi_measure_buffer_hold = nil; |
148 end | 150 end |