Bind HMS connection with -bindaddr

This commit is contained in:
James R 2020-05-13 15:29:17 -07:00
parent 9dc72f46a2
commit 430fb27ec8

View file

@ -19,6 +19,7 @@ Documentation available here.
#include "doomdef.h" #include "doomdef.h"
#include "d_clisrv.h" #include "d_clisrv.h"
#include "command.h" #include "command.h"
#include "m_argv.h"
#include "m_menu.h" #include "m_menu.h"
#include "mserv.h" #include "mserv.h"
#include "i_tcp.h"/* for current_port */ #include "i_tcp.h"/* for current_port */
@ -144,6 +145,11 @@ HMS_connect (const char *format, ...)
curl_easy_setopt(curl, CURLOPT_STDERR, logstream); curl_easy_setopt(curl, CURLOPT_STDERR, logstream);
} }
if (M_CheckParm("-bindaddr") && M_IsNextParm())
{
curl_easy_setopt(curl, CURLOPT_INTERFACE, M_GetNextParm());
}
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);