Software /
code /
prosody
Changeset
9909:3229be01a08a
mod_csi_simple: Use write locks in net.server if available
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 24 Nov 2018 02:25:44 +0100 |
parents | 9908:7d12af856238 |
children | 9910:7a703af90c9c |
files | plugins/mod_csi_simple.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_csi_simple.lua Sun Mar 24 08:18:19 2019 +0000 +++ b/plugins/mod_csi_simple.lua Sat Nov 24 02:25:44 2018 +0100 @@ -86,7 +86,9 @@ module:hook("csi-client-inactive", function (event) local session = event.origin; - if session.pump then + if session.conn and session.conn and session.conn.pause_writes then + session.conn:pause_writes(); + elseif session.pump then session.pump:pause(); else local bare_jid = jid.join(session.username, session.host); @@ -115,6 +117,8 @@ local session = event.origin; if session.pump then session.pump:resume(); + elseif session.conn and session.conn and session.conn.resume_writes then + session.conn:resume_writes(); end end);