aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-28 22:59:29 +0200
committerKim Alvefur <zash@zash.se>2019-09-28 22:59:29 +0200
commitfad52c768601de198e5c277d547528bfac1f6166 (patch)
tree92e0ddf1c3ac0a04240db2c1f5d42d3097e63fe3
parent01e73988778bf20b8ff5ded517459c7ead977009 (diff)
downloadprosody-fad52c768601de198e5c277d547528bfac1f6166.tar.gz
prosody-fad52c768601de198e5c277d547528bfac1f6166.zip
mod_csi_simple: Remove duplicated check for connection
-rw-r--r--plugins/mod_csi_simple.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua
index 13002ea8..4e2b95e1 100644
--- a/plugins/mod_csi_simple.lua
+++ b/plugins/mod_csi_simple.lua
@@ -81,7 +81,7 @@ local function flush_buffer(data, session)
end
function enable_optimizations(session)
- if session.conn and session.conn and session.conn.pause_writes then
+ if session.conn and session.conn.pause_writes then
session.conn:pause_writes();
filters.add_filter(session, "stanzas/out", manage_buffer);
filters.add_filter(session, "bytes/in", flush_buffer);
@@ -91,7 +91,7 @@ function enable_optimizations(session)
end
function disable_optimizations(session)
- if session.conn and session.conn and session.conn.resume_writes then
+ if session.conn and session.conn.resume_writes then
filters.remove_filter(session, "stanzas/out", manage_buffer);
filters.remove_filter(session, "bytes/in", flush_buffer);
session.conn:resume_writes();
@@ -115,7 +115,7 @@ end);
module:hook("c2s-ondrain", function (event)
local session = event.session;
- if session.state == "inactive" and session.conn and session.conn and session.conn.pause_writes then
+ if session.state == "inactive" and session.conn and session.conn.pause_writes then
session.conn:pause_writes();
session.log("debug", "Buffer flushed, resuming inactive mode (queue size was %d)", session.csi_counter);
session.csi_counter = 0;