diff options
author | Kim Alvefur <zash@zash.se> | 2019-09-28 22:59:29 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-09-28 22:59:29 +0200 |
commit | 8369b96e16a57ce3b80caf13f5eeb536747e177f (patch) | |
tree | 92e0ddf1c3ac0a04240db2c1f5d42d3097e63fe3 | |
parent | f0907daf21057fa3b78d3e2d5dec379407de8c0c (diff) | |
download | prosody-8369b96e16a57ce3b80caf13f5eeb536747e177f.tar.gz prosody-8369b96e16a57ce3b80caf13f5eeb536747e177f.zip |
mod_csi_simple: Remove duplicated check for connection
-rw-r--r-- | plugins/mod_csi_simple.lua | 6 |
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; |