aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-11-24 02:25:44 +0100
committerKim Alvefur <zash@zash.se>2018-11-24 02:25:44 +0100
commit8e68b0dd1adfcd7932f368a0b00dd2019c95db38 (patch)
tree68ec4fdd07393bba14e956c23cdbbd03574bf93d
parentee0fd8f1d90b736597baff3d7e1fd7dd1d28240b (diff)
downloadprosody-8e68b0dd1adfcd7932f368a0b00dd2019c95db38.tar.gz
prosody-8e68b0dd1adfcd7932f368a0b00dd2019c95db38.zip
mod_csi_simple: Use write locks in net.server if available
-rw-r--r--plugins/mod_csi_simple.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index da2dd953..abe65fce 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -86,7 +86,9 @@ end, -1);
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 @@ module:hook("csi-client-active", function (event)
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);