Get rid off getnameinfo.

This commit is contained in:
Jean-Baptiste Perrier
2021-01-25 17:52:11 +01:00
parent 8e2a8c045c
commit 330a588260

View File

@@ -57,14 +57,8 @@ static NetworkIPVersion GetIPVersionFromAddr(const sockaddr& addr)
// getnameinfo return a name ( like JimiPC ), not the ip!
static bool CreateEndPointFromAddr(sockaddr* addr, NetworkEndPoint& endPoint)
{
uint16 size = GetAddrSize(*addr);
char name[100];
char service[20];
if (getnameinfo(addr, size, name, sizeof name, service, sizeof service, 0) != 0)
{
LOG(Error, "Unable to extract info from sockaddr! Error : {0}", GetLastErrorMessage().Get());
return true;
}
uint32 size = GetAddrSize(*addr);
uint16 port;
void* paddr;
if (addr->sa_family == AF_INET6)
{