masterserver_debug to set CURLOPT_VERBOSE

This commit is contained in:
James R 2020-03-01 11:39:27 -08:00
parent 8228182823
commit 2cfb04f90b
3 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,11 @@ consvar_t cv_masterserver_token = {
NULL, NULL, 0, NULL, NULL, 0, 0, NULL/* C90 moment */
};
consvar_t cv_masterserver_debug = {
"masterserver_debug", "Off", CV_SAVE, CV_OnOff,
NULL, 0, NULL, NULL, 0, 0, NULL/* C90 moment */
};
static int hms_started;
static char hms_server_token[sizeof "xxx.xxx.xxx.xxx/xxxxx"];
@ -97,6 +102,8 @@ HMS_connect (const char *format, ...)
buffer->buffer = malloc(buffer->end);
buffer->needle = 0;
if (cv_masterserver_debug.value)
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

View File

@ -233,6 +233,7 @@ void AddMServCommands(void)
CV_RegisterVar(&cv_masterserver);
CV_RegisterVar(&cv_http_masterserver);
CV_RegisterVar(&cv_masterserver_token);
CV_RegisterVar(&cv_masterserver_debug);
CV_RegisterVar(&cv_servername);
COM_AddCommand("listserv", Command_Listserv_f);
#endif

View File

@ -66,6 +66,7 @@ typedef struct
extern consvar_t cv_masterserver, cv_servername;
extern consvar_t cv_http_masterserver;
extern consvar_t cv_masterserver_token;
extern consvar_t cv_masterserver_debug;
// < 0 to not connect (usually -1) (offline mode)
// == 0 to show all rooms, not a valid hosting room