diff options
author | Kim Alvefur <zash@zash.se> | 2019-03-24 19:02:40 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-03-24 19:02:40 +0100 |
commit | 3a1498ebd335a15a987e3087f84089620b5507c5 (patch) | |
tree | 71f3473f87f8a10bc74f73db3557e111f2087c94 /plugins | |
parent | 141c5d3fbe257cf63249eeec528dd36b3266b25e (diff) | |
download | prosody-3a1498ebd335a15a987e3087f84089620b5507c5.tar.gz prosody-3a1498ebd335a15a987e3087f84089620b5507c5.zip |
mod_csi_simple: Also flush buffer in "pump" mode
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_csi_simple.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index 07a8cfb3..ee7e01c9 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -109,9 +109,15 @@ local function flush_buffer(data, session) return data; end +local function flush_pump(data, session) + session.pump:flush(); + return data; +end + module:hook("csi-client-inactive", function (event) local session = event.origin; if session.conn and session.conn and session.conn.pause_writes then + session.log("info", "Native net.server buffer management mode"); session.conn:pause_writes(); filters.add_filter(session, "stanzas/out", manage_buffer); filters.add_filter(session, "bytes/in", flush_buffer); @@ -124,6 +130,7 @@ module:hook("csi-client-inactive", function (event) local pump = new_pump(session.send, queue_size); pump:pause(); session.pump = pump; + filters.add_filter(session, "bytes/in", flush_pump); function session.send(stanza) if session.state == "active" or module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then pump:flush(); |