[ADD/WIP] Timeouts in stanza awaiting

Querying for a MUC will not take longer than 10 seconds, now.
This commit is contained in:
LDA 2024-07-09 16:26:35 +02:00
commit d449c8097e
4 changed files with 52 additions and 12 deletions

View file

@ -15,7 +15,6 @@ XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out)
char *uuid, *from;
if (!jabber || !muc)
{
Log(LOG_WARNING, ":(");
return false;
}
@ -40,8 +39,9 @@ XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out)
StreamFlush(jabber->stream);
XMLFreeElement(iq_query);
/* Except an IQ reply */
iq_query = ParseeAwaitStanza(uuid);
/* Except an IQ reply. 10 seconds of timeout is pretty
* generous, if you ask me. */
iq_query = ParseeAwaitStanza(uuid, 10 SECONDS);
Free(uuid);
if (!iq_query || !StrEquals(iq_query->name, "iq"))
{