Tue, 03 Nov 2015 17:37:15 +0100
scansion.objects.client: Hold of reading from clients when they are not expecting stanzas
scansion/objects/client.lua | file | annotate | diff | comparison | revisions |
--- a/scansion/objects/client.lua Wed Oct 28 02:26:53 2015 +0100 +++ b/scansion/objects/client.lua Tue Nov 03 17:37:15 2015 +0100 @@ -53,7 +53,7 @@ connects = function (client) local wait, done = async.waiter(); - client.stream:hook("ready", function () client.log"ready" done() client.log("ready done") end); + client.stream:hook("ready", function () client.log"ready" done() client.log("ready done") client.stream.conn:pause() end); client.stream:connect_client(client.jid, client.password); wait(); client.full_jid = client.stream.jid; @@ -79,6 +79,7 @@ end expected_stanza = nil; client.stream:unhook("stanza", stanza_handler); + client.stream.conn:pause(); done(); end client.stream:hook("stanza", stanza_handler, 100); @@ -88,6 +89,7 @@ error("Timed out waiting for stanza"); done(); end); + client.stream.conn:resume(); wait(); end;