Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
10302:4c53e58d2468 | 10303:c434bff22b14 |
---|---|
93 session.log("warn", "Session connection does not support write pausing"); | 93 session.log("warn", "Session connection does not support write pausing"); |
94 end | 94 end |
95 end | 95 end |
96 | 96 |
97 function disable_optimizations(session) | 97 function disable_optimizations(session) |
98 session.csi_flushing = nil; | |
99 filters.remove_filter(session, "stanzas/out", manage_buffer); | |
100 filters.remove_filter(session, "bytes/in", flush_buffer); | |
98 if session.conn and session.conn.resume_writes then | 101 if session.conn and session.conn.resume_writes then |
99 session.csi_flushing = nil; | |
100 filters.remove_filter(session, "stanzas/out", manage_buffer); | |
101 filters.remove_filter(session, "bytes/in", flush_buffer); | |
102 session.conn:resume_writes(); | 102 session.conn:resume_writes(); |
103 end | 103 end |
104 end | 104 end |
105 | 105 |
106 module:hook("csi-client-inactive", function (event) | 106 module:hook("csi-client-inactive", function (event) |