# HG changeset patch # User Kim Alvefur # Date 1570287358 -7200 # Node ID c434bff22b1484858bd4ed93dbf3c6a77a329bc4 # Parent 4c53e58d2468e529f54ae617baa2e7853eaf4717 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. diff -r 4c53e58d2468 -r c434bff22b14 plugins/mod_csi_simple.lua --- 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