* net_sdlnet.c: Pass "localhost" instead of NULL to SDLNet_ResolveHost().

added some remarks about missing functionality in SDL_net.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@198 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2010-06-20 12:50:51 +00:00
parent 57aa7ed713
commit 77ac562f2d

View file

@ -83,7 +83,8 @@ static char *_AddrToString (int ip, int port)
{
static char buffer[22];
sprintf(buffer, "%d.%d.%d.%d:%d", (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff, port);
sprintf(buffer, "%d.%d.%d.%d:%d", (ip >> 24) & 0xff, (ip >> 16) & 0xff,
(ip >> 8) & 0xff, ip & 0xff, port);
return buffer;
}
@ -136,8 +137,11 @@ int SDLN_Init (void)
}
else
{
SDLNet_ResolveHost(&myaddr, NULL, 0);
strcpy(my_tcpip_address, "INADDR_ANY");
/* with SDL_net, there is no way of doing an
equivalent of gethostaddr() / gethostbyname()
so we do this crap as a fallback. */
SDLNet_ResolveHost(&myaddr, "localhost", 0);
strcpy(my_tcpip_address, _IPAddrToString(&myaddr));
}
// open the control socket
@ -169,7 +173,7 @@ void SDLN_GetLocalAddress (void)
if (myaddr.host != INADDR_ANY)
return;
SDLNet_ResolveHost(&myaddr, NULL, 0);
SDLNet_ResolveHost(&myaddr, "localhost", 0);
}
void SDLN_Listen (qboolean state)