[MOD] Make functions for creating a "killer stanza"

Cleaning up the mop...
This commit is contained in:
LDA 2024-06-19 14:41:04 +02:00
commit e089cea02a
4 changed files with 46 additions and 16 deletions

View file

@ -34,21 +34,8 @@ SignalHandler(int signal)
return;
}
/* Create a loopback stanza, forcing the thread to die */
from = StrConcat(2, "jabber_die@", jabber->host);
message = XMLCreateTag("message");
XMLAddAttr(message, "from", from);
XMLAddAttr(message, "to", from);
XMLAddAttr(message, "type", "kill_parsee");
body = XMLCreateTag("body");
XMLAddChild(message, body);
XMLEncode(jabber->stream, message);
StreamFlush(jabber->stream);
XMLFreeElement(message);
Free(from);
XMPPKillThread(jabber);
HttpServerStop(server);
//pthread_cancel(xmpp_thr);
break;
}
}
@ -84,6 +71,7 @@ Main(void)
))
{
Log(LOG_ERR, "Could not connect to XMPP...");
XMPPEndCompStream(jabber);
goto end;
}
}