diff -r 0ee626030acb -r f90056b8e278 scansion/objects/client.lua --- a/scansion/objects/client.lua Thu Feb 18 19:02:28 2016 +0000 +++ b/scansion/objects/client.lua Fri Feb 19 11:47:33 2016 +0000 @@ -4,7 +4,7 @@ local parse_xml = require "scansion.xml".parse; -local stanza_timeout = 5; +local default_stanza_timeout = 3; local stanzacmp = require "scansion.stanzacmp"; @@ -101,11 +101,15 @@ done(); end client.stream:hook("stanza", stanza_handler, 100); - verse.add_task(stanza_timeout, function () - if not expected_stanza then return; end -- Stanza already received - client.log("TIMEOUT waiting for %s", expected_stanza) - error("Timed out waiting for stanza"); - done(); + verse.add_task(client.stanza_timeout or default_stanza_timeout, function () + if expected_stanza then + client.log("TIMEOUT waiting for %s", expected_stanza) + error("Timed out waiting for stanza"); + end + if expected_stanza == false then + client.log("Good - no stanzas were received (expected)"); + done(); + end end); client.stream.conn:resume(); wait();