aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_csi_simple.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-05 16:55:58 +0200
committerKim Alvefur <zash@zash.se>2019-10-05 16:55:58 +0200
commit2e1a43906f35d4feaa7398eb1f4848fcdda3bd5c (patch)
tree2fae7595c9933d6179c80cb4f8b5a595fb7f58ba /plugins/mod_csi_simple.lua
parent1356b90c3a135009a5b6ba5c56b2f4a407f7fc3a (diff)
downloadprosody-2e1a43906f35d4feaa7398eb1f4848fcdda3bd5c.tar.gz
prosody-2e1a43906f35d4feaa7398eb1f4848fcdda3bd5c.zip
mod_csi_simple: Always remove session filters when disabling CSI
Only guard the actual pausing of outgoing data on the method existing. This prevents the filters from lingering in case something happened to the connection. Removing already removed filters should be a safe noop.
Diffstat (limited to 'plugins/mod_csi_simple.lua')
-rw-r--r--plugins/mod_csi_simple.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index b99aaab3..24a2f1ce 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -95,10 +95,10 @@ function enable_optimizations(session)
end
function disable_optimizations(session)
+ session.csi_flushing = nil;
+ filters.remove_filter(session, "stanzas/out", manage_buffer);
+ filters.remove_filter(session, "bytes/in", flush_buffer);
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();
end
end