aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_csi_simple.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_csi_simple.lua')
-rw-r--r--plugins/mod_csi_simple.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 5c829179..07a8cfb3 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -104,11 +104,17 @@ local function manage_buffer(stanza, session)
return stanza;
end
+local function flush_buffer(data, session)
+ session.conn:resume_writes();
+ 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.conn:pause_writes();
filters.add_filter(session, "stanzas/out", manage_buffer);
+ filters.add_filter(session, "bytes/in", flush_buffer);
elseif session.pump then
session.pump:pause();
else
@@ -136,6 +142,7 @@ module:hook("csi-client-active", function (event)
session.pump:resume();
elseif session.conn and session.conn and session.conn.resume_writes then
filters.remove_filter(session, "stanzas/out", manage_buffer);
+ filters.remove_filter(session, "bytes/in", flush_buffer);
session.conn:resume_writes();
end
end);