Diff

plugins/mod_csi_simple.lua @ 10303:c434bff22b14

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.
author Kim Alvefur <zash@zash.se>
date Sat, 05 Oct 2019 16:55:58 +0200
parent 10302:4c53e58d2468
child 10414:51ebfdeccad7
line wrap: on
line diff
--- a/plugins/mod_csi_simple.lua	Sat Oct 05 16:50:41 2019 +0200
+++ b/plugins/mod_csi_simple.lua	Sat Oct 05 16:55:58 2019 +0200
@@ -95,10 +95,10 @@
 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