68 client.stream:unhook("stanza", stanza_handler); |
68 client.stream:unhook("stanza", stanza_handler); |
69 done(); |
69 done(); |
70 end |
70 end |
71 client.stream:hook("stanza", stanza_handler, 100); |
71 client.stream:hook("stanza", stanza_handler, 100); |
72 verse.add_task(stanza_timeout, function () |
72 verse.add_task(stanza_timeout, function () |
73 if not expected_stanza then return; end |
73 if not expected_stanza then return; end -- Stanza already received |
74 client.log("TIMEOUT waiting for %s", expected_stanza) |
74 client.log("TIMEOUT waiting for %s", expected_stanza) |
75 error("Timed out waiting for stanza"); |
75 error("Timed out waiting for stanza"); |
76 done(); |
76 done(); |
77 end); |
77 end); |
78 wait(); |
78 wait(); |