client: Fix harmless error logged when calling 'done' too many times

Thu, 23 Mar 2023 15:15:01 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Mar 2023 15:15:01 +0000
changeset 176
7674fb1dcc41
parent 175
e48074386468
child 177
3c19b67a1f0f

client: Fix harmless error logged when calling 'done' too many times

scansion/objects/client.lua file | annotate | diff | comparison | revisions
--- a/scansion/objects/client.lua	Thu Mar 23 15:13:14 2023 +0000
+++ b/scansion/objects/client.lua	Thu Mar 23 15:15:01 2023 +0000
@@ -107,11 +107,15 @@
 			return true;
 		end
 		client.stream:hook("stanza", stanza_handler, 100);
+		local finished_waiting;
 		verse.add_task(client.stanza_timeout or default_stanza_timeout, function ()
-			done();
+			if not finished_waiting then
+				done();
+			end
 		end);
 		client.stream.conn:resume();
 		wait();
+		finished_waiting = true;
 
 		if not have_received_stanza then
 			if expected_stanza then

mercurial