mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
Fixed crash on attempt to send stats without network connection
https://forum.zdoom.org/viewtopic.php?t=59844
This commit is contained in:
parent
b4d3715345
commit
ecff13ac2e
1 changed files with 5 additions and 0 deletions
|
@ -57,6 +57,11 @@ bool I_HTTPRequest(const char* request)
|
||||||
SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
SOCKET Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
struct hostent *host;
|
struct hostent *host;
|
||||||
host = gethostbyname(sys_statshost.GetHumanString());
|
host = gethostbyname(sys_statshost.GetHumanString());
|
||||||
|
if (host == nullptr)
|
||||||
|
{
|
||||||
|
DPrintf(DMSG_ERROR, "Error looking up hostname.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
SOCKADDR_IN SockAddr;
|
SOCKADDR_IN SockAddr;
|
||||||
SockAddr.sin_port = htons(sys_statsport);
|
SockAddr.sin_port = htons(sys_statsport);
|
||||||
SockAddr.sin_family = AF_INET;
|
SockAddr.sin_family = AF_INET;
|
||||||
|
|
Loading…
Reference in a new issue