mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
Remove almost all uses of NetAddress.
This probably has a bunch of bugs because of Network Order/Host Order issues. If we intend to actually support BE architectures, these problems are going to get much much worse :(
This commit is contained in:
@ -547,12 +547,11 @@ static SOCKET ListenSocket (NetAddress * listenAddr) {
|
||||
sockaddr_in addr;
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons((uint16_t)port);
|
||||
addr.sin_addr.S_un.S_addr = htonl(node);
|
||||
addr.sin_addr.S_un.S_addr = node;
|
||||
memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
|
||||
if (bind(s, (sockaddr *) &addr, sizeof(addr))) {
|
||||
wchar_t str[32];
|
||||
NetAddressToString(*listenAddr, str, arrsize(str), kNetAddressFormatAll);
|
||||
LogMsg(kLogError, "bind to addr %s failed (err %u)", str, WSAGetLastError());
|
||||
plString str = listenAddr->AsString();
|
||||
LogMsg(kLogError, "bind to addr %s failed (err %u)", str.c_str(), WSAGetLastError());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -340,13 +340,10 @@ void AsyncAddressLookupAddr (
|
||||
lookup->lookupProc = lookupProc;
|
||||
lookup->port = 1;
|
||||
lookup->param = param;
|
||||
NetAddressToString(
|
||||
address,
|
||||
lookup->name,
|
||||
arrsize(lookup->name),
|
||||
kNetAddressFormatNodeNumber
|
||||
);
|
||||
|
||||
|
||||
plString str = address.GetHostString();
|
||||
lookup->name = str.toUtf16().GetData();
|
||||
|
||||
s_critsect.Enter();
|
||||
{
|
||||
// Start the lookup thread if it wasn't started already
|
||||
|
Reference in New Issue
Block a user