mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-12 23:44:21 +00:00
Applied a cleanup to qw's net_udp.c's error messages
This commit is contained in:
parent
0da23b9a52
commit
d42a1abed2
2 changed files with 10 additions and 5 deletions
4
AUTHORS
4
AUTHORS
|
@ -80,6 +80,7 @@ Misc Code Fixes:
|
||||||
|
|
||||||
Cheat/exploit fixes:
|
Cheat/exploit fixes:
|
||||||
Mads Bondo Dydensborg <madsdyd@challenge.dk>
|
Mads Bondo Dydensborg <madsdyd@challenge.dk>
|
||||||
|
Zephaniah E. Hull <warp@whitestar.soark.net>
|
||||||
|
|
||||||
Win32 support:
|
Win32 support:
|
||||||
Marcus Sundberg <mackan@stacken.kth.se>
|
Marcus Sundberg <mackan@stacken.kth.se>
|
||||||
|
@ -92,3 +93,6 @@ CD-ROM support/optimizations:
|
||||||
AIX/IRIX/Sun support:
|
AIX/IRIX/Sun support:
|
||||||
Loring Holden <lsh@cs.brown.edu>
|
Loring Holden <lsh@cs.brown.edu>
|
||||||
Tim Rowley <tor@cs.brown.edu>
|
Tim Rowley <tor@cs.brown.edu>
|
||||||
|
|
||||||
|
Network code fixes/cleanups:
|
||||||
|
Roger Sen Montero <rogersm@tau.uab.es>
|
||||||
|
|
|
@ -192,7 +192,7 @@ qboolean NET_IsClientLegal(netadr_t *adr)
|
||||||
NetadrToSockadr (adr, &sadr);
|
NetadrToSockadr (adr, &sadr);
|
||||||
|
|
||||||
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
||||||
Sys_Error ("NET_IsClientLegal: socket:", strerror(errno));
|
Sys_Error ("NET_IsClientLegal: socket: %s", strerror(errno));
|
||||||
|
|
||||||
sadr.sin_port = 0;
|
sadr.sin_port = 0;
|
||||||
|
|
||||||
|
@ -299,9 +299,9 @@ int UDP_OpenSocket (int port)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
|
||||||
Sys_Error ("UDP_OpenSocket: socket:", strerror(errno));
|
Sys_Error ("UDP_OpenSocket: socket: %s", strerror(errno));
|
||||||
if (ioctl (newsocket, FIONBIO, &_true) == -1)
|
if (ioctl (newsocket, FIONBIO, &_true) == -1)
|
||||||
Sys_Error ("UDP_OpenSocket: ioctl FIONBIO:", strerror(errno));
|
Sys_Error ("UDP_OpenSocket: ioctl FIONBIO: %s", strerror(errno));
|
||||||
address.sin_family = AF_INET;
|
address.sin_family = AF_INET;
|
||||||
//ZOID -- check for interface binding option
|
//ZOID -- check for interface binding option
|
||||||
if ((i = COM_CheckParm("-ip")) != 0 && i < com_argc) {
|
if ((i = COM_CheckParm("-ip")) != 0 && i < com_argc) {
|
||||||
|
@ -326,14 +326,15 @@ void NET_GetLocalAddress (void)
|
||||||
struct sockaddr_in address;
|
struct sockaddr_in address;
|
||||||
int namelen;
|
int namelen;
|
||||||
|
|
||||||
gethostname(buff, MAXHOSTNAMELEN);
|
if (gethostname(buff, MAXHOSTNAMELEN) == -1)
|
||||||
|
Sys_Error ("Net_GetLocalAddress: gethostname: %s", strerror(errno));
|
||||||
buff[MAXHOSTNAMELEN-1] = 0;
|
buff[MAXHOSTNAMELEN-1] = 0;
|
||||||
|
|
||||||
NET_StringToAdr (buff, &net_local_adr);
|
NET_StringToAdr (buff, &net_local_adr);
|
||||||
|
|
||||||
namelen = sizeof(address);
|
namelen = sizeof(address);
|
||||||
if (getsockname (net_socket, (struct sockaddr *)&address, &namelen) == -1)
|
if (getsockname (net_socket, (struct sockaddr *)&address, &namelen) == -1)
|
||||||
Sys_Error ("NET_Init: getsockname:", strerror(errno));
|
Sys_Error ("NET_GetLocalAddress: getsockname: %s", strerror(errno));
|
||||||
net_local_adr.port = address.sin_port;
|
net_local_adr.port = address.sin_port;
|
||||||
|
|
||||||
Con_Printf("IP address %s\n", NET_AdrToString (net_local_adr) );
|
Con_Printf("IP address %s\n", NET_AdrToString (net_local_adr) );
|
||||||
|
|
Loading…
Reference in a new issue