# HG changeset patch # User Kim Alvefur # Date 1446568635 -3600 # Node ID afc7765827be5ad455d0e6d35082b98b07fe5fdb # Parent 0ce9c9a0c2a0c3bc711b9d138b224ea1525583f4 scansion.objects.client: Hold of reading from clients when they are not expecting stanzas diff -r 0ce9c9a0c2a0 -r afc7765827be scansion/objects/client.lua --- 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;