# HG changeset patch # User Kim Alvefur # Date 1543022744 -3600 # Node ID 3229be01a08a37c4498200089355a2b4c70e37a5 # Parent 7d12af8562383a263f311b09454750114d06c37a mod_csi_simple: Use write locks in net.server if available diff -r 7d12af856238 -r 3229be01a08a plugins/mod_csi_simple.lua --- 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);