Master server: use I_OutputMsg during startup

CONS_Printf calls CON_Drawer during startup, thread
collision stuff.
This commit is contained in:
James R 2022-08-19 20:05:05 -07:00
parent 2137a096e6
commit f2534f8cb5

View file

@ -21,6 +21,7 @@ Documentation available here.
#include "doomdef.h"
#include "d_clisrv.h"
#include "command.h"
#include "console.h"
#include "m_argv.h"
#include "m_menu.h"
#include "mserv.h"
@ -78,6 +79,19 @@ Contact_error (void)
);
}
static void
Printf_url (const char *url)
{
boolean startup;
I_lock_mutex(&con_mutex);
startup = con_startup;
I_unlock_mutex(con_mutex);
(startup ? I_OutputMsg : CONS_Printf)(
"HMS: connecting '%s'...\n", url);
}
static size_t
HMS_on_read (char *s, size_t _1, size_t n, void *userdata)
{
@ -177,7 +191,7 @@ HMS_connect (const char *format, ...)
if (quack_token)
sprintf(&url[seek], "&token=%s", quack_token);
CONS_Printf("HMS: connecting '%s'...\n", url);
Printf_url(url);
buffer = malloc(sizeof *buffer);
buffer->curl = curl;