[ADD/WIP] Parsee IDs, -v flag

This commit is contained in:
LDA 2024-08-16 16:38:21 +02:00
commit aa9b68e02d
7 changed files with 56 additions and 13 deletions

View file

@ -170,7 +170,10 @@ ParseeXMPPThread(void *argp)
pthread_t *thr = &info.dispatchers[i].thr;
info.dispatchers[i].info = &info;
pthread_create(thr, NULL, XMPPDispatcher, &info.dispatchers[i]);
if (pthread_create(thr, NULL, XMPPDispatcher, &info.dispatchers[i]))
{
Achievement("COULDNT INITIALISE XMPP DISPATCHERS", true);
}
}
while (true)
@ -213,15 +216,25 @@ ParseeXMPPThread(void *argp)
}
info.running = false;
Log(LOG_INFO, "Joining subthreads...");
for (i = 0; i < info.available_dispatchers; i++)
{
pthread_t thr = info.dispatchers[i].thr;
pthread_join(thr, NULL);
if (pthread_join(thr, NULL))
{
Achievement("COULDNT JOIN XMPP DISPATCHER", true);
}
Log(LOG_DEBUG, "- joined %d/%d...",
i + 1, info.available_dispatchers
);
}
Log(LOG_INFO, "Joined subthreads...");
Free(info.dispatchers);
if (ArraySize(info.stanzas))
{
Log(LOG_DEBUG, "(%d unprocessed stanzas)", ArraySize(info.stanzas));
}
for (i = 0; i < ArraySize(info.stanzas); i++)
{
XMLFreeElement(ArrayGet(info.stanzas, i));