[FIX] Kill Parsee on unexcepted stream closure

This commit is contained in:
LDA 2024-10-20 12:53:07 +02:00
commit 02a89270c0
6 changed files with 49 additions and 15 deletions

View file

@ -60,6 +60,7 @@ typedef struct ParseeData {
HttpRouter *router;
CommandRouter *handler;
HttpServer *server;
XMPPComponent *jabber;
Db *db;
@ -69,6 +70,10 @@ typedef struct ParseeData {
HashMap *oid_servers;
pthread_mutex_t oidl;
/* If Parsee was intentionally halted */
bool halted;
pthread_mutex_t halt_lock;
} ParseeData;
typedef struct Argument {
@ -285,7 +290,11 @@ extern bool ParseeGetDMOrigin(ParseeData *data, char *chat_id, char *ev, char **
/* Sends presence requests for every MUC around as a fake JID */
extern void ParseeSendPresence(ParseeData *);
extern bool ParseeInitialiseSignals(HttpServer *, pthread_t, XMPPComponent *);
/** Initialises signal-handling code within Parsee.
* --------------------
* Modifies: the signal handler
* Returns: whenever it has properly been setup */
extern bool ParseeInitialiseSignals(ParseeData *data, pthread_t xmpp);
/* Job used to cleanup Parsee data that isn't necessary anymore. */
extern void ParseeCleanup(void *data);