Diff

clix.lua @ 169:4e67d34c1298

clix: Remove Tigase COMPAT The bufferlen method is specific to server_select, so this breaks on server_epoll
author Kim Alvefur <zash@zash.se>
date Sat, 24 Jun 2023 09:49:03 +0200
parent 168:75e8ca131178
child 171:eb7625161d76
line wrap: on
line diff
--- 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