[ADD] Make and start using an XML encoder

Now, we have basic sanitation!!!!!!
This commit is contained in:
LDA 2024-06-19 02:33:53 +02:00
commit b408cbf224
4 changed files with 110 additions and 19 deletions

View file

@ -47,12 +47,14 @@ Main(void)
ParseeConfigLoad("parsee.json");
ParseeConfigInit();
/* Write out the config file to a YAML document */
yaml = StreamOpen("parsee.yaml", "w");
ParseeExportConfigYAML(yaml);
StreamClose(yaml);
parsee_conf = ParseeConfigGet();
{
Log(LOG_NOTICE, "Connecting to XMPP...");
jabber = XMPPInitialiseCompStream(
parsee_conf->component_host,
parsee_conf->component_port
@ -63,6 +65,7 @@ Main(void)
);
}
Log(LOG_NOTICE, "Setting up local Matrix user...");
ASRegisterUser(parsee_conf, parsee_conf->sender_localpart);
memset(&conf, 0, sizeof(conf));
@ -72,6 +75,7 @@ Main(void)
conf.handlerArgs = ParseeInitData(jabber);
conf.handler = ParseeRequest;
Log(LOG_NOTICE, "Creating XMPP listener thread...");
if (pthread_create(&xmpp_thr, NULL, ParseeXMPPThread, conf.handlerArgs))
{
Log(LOG_ERR, "Couldn't start XMPP listener thread.");
@ -99,11 +103,8 @@ Main(void)
#undef SIGACTION
/* TODO: The rest of Parsee. */
server = HttpServerCreate(&conf);
HttpServerStart(server);
/* TODO: Manage signals(^C) with finesse */
HttpServerJoin(server);
HttpServerFree(server);