# HG changeset patch # User Kim Alvefur # Date 1569704369 -7200 # Node ID 45a58127a3e5a77f0a453f745fec315703d9996f # Parent 4e4ce7400b3932e67326b476f27abebce5ac6cbb mod_csi_simple: Remove duplicated check for connection diff -r 4e4ce7400b39 -r 45a58127a3e5 plugins/mod_csi_simple.lua --- a/plugins/mod_csi_simple.lua Sat Sep 28 20:00:39 2019 +0200 +++ b/plugins/mod_csi_simple.lua Sat Sep 28 22:59:29 2019 +0200 @@ -81,7 +81,7 @@ 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 @@ 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 @@ 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;