clix: Remove Tigase COMPAT

Sat, 24 Jun 2023 09:49:03 +0200

author
Kim Alvefur <zash@zash.se>
date
Sat, 24 Jun 2023 09:49:03 +0200
changeset 169
4e67d34c1298
parent 168
75e8ca131178
child 170
0d561f921c13

clix: Remove Tigase COMPAT

The bufferlen method is specific to server_select, so this breaks on
server_epoll

clix.lua file | annotate | diff | comparison | revisions
--- a/clix.lua	Fri May 26 22:39:38 2023 +0200
+++ b/clix.lua	Sat Jun 24 09:49:03 2023 +0200
@@ -129,36 +129,6 @@
 	
 	-- Connect!
 	conn:connect_client(account.jid, account.password, clientkey, serverkey);
-	
-	-- COMPAT: Tigase discards stanzas sent at the same time as </stream:stream>
-	local _real_close = conn.close;
-	function conn:close()
-		conn:debug("Delaying close...");
-		local function close_conn()
-			local function do_close()
-				if _real_close then
-					conn:debug("Closing now...");
-					local close = _real_close;
-					_real_close = nil;
-					close(conn);
-				end
-			end
-			local close_delay = tonumber(opts.close_delay) or 0;
-			if close_delay > 0 then
-				verse.add_task(close_delay, do_close);
-			else
-				do_close();
-			end
-		end
-		if conn.conn:bufferlen() == 0 then
-			close_conn();
-		else
-			conn:hook("drained", close_conn);
-		end
-	end
-	-- /COMPAT
-	
-	
 	if type(opts.resource) == "string" then
 		conn.resource = opts.resource;
 	end

mercurial