mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-24 02:40:41 +01:00
Fix network send packet
This commit is contained in:
parent
314a6deba9
commit
de35262a3b
@ -1397,7 +1397,7 @@ NET_SendPacket
|
||||
*/
|
||||
void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to )
|
||||
{
|
||||
int ret, err;
|
||||
int ret;
|
||||
struct sockaddr addr;
|
||||
SOCKET net_socket;
|
||||
|
||||
@ -1427,11 +1427,11 @@ void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to
|
||||
|
||||
ret = NET_SendLong( sock, net_socket, data, length, 0, &addr, sizeof( addr ));
|
||||
|
||||
if( NET_IsSocketError( err ))
|
||||
if( NET_IsSocketError( ret ))
|
||||
{
|
||||
{
|
||||
#ifdef _WIN32
|
||||
err = pWSAGetLastError();
|
||||
int err = pWSAGetLastError();
|
||||
|
||||
// WSAEWOULDBLOCK is silent
|
||||
if( err == WSAEWOULDBLOCK )
|
||||
@ -1457,7 +1457,7 @@ void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to
|
||||
#ifdef _WIN32
|
||||
else if( err == WSAEADDRNOTAVAIL || err == WSAENOBUFS )
|
||||
#else
|
||||
else if( err == EADDRNOTAVAIL || err == ENOBUFS )
|
||||
else if( errno == EADDRNOTAVAIL || errno == ENOBUFS )
|
||||
#endif
|
||||
{
|
||||
MsgDev( D_ERROR, "NET_SendPacket: %s to %s\n", NET_ErrorString(), NET_AdrToString( to ));
|
||||
|
Loading…
Reference in New Issue
Block a user