Changeset

10277:45a58127a3e5

mod_csi_simple: Remove duplicated check for connection
author Kim Alvefur <zash@zash.se>
date Sat, 28 Sep 2019 22:59:29 +0200
parents 10276:4e4ce7400b39
children 10278:94c584d67533
files plugins/mod_csi_simple.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;