mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Mac OS fix
This commit is contained in:
parent
1ca233988b
commit
9665dd67de
|
@ -1582,13 +1582,13 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
|
||||||
#else
|
#else
|
||||||
if(bytes == 0 && sock.ipv4sock >= 0)
|
if(bytes == 0 && sock.ipv4sock >= 0)
|
||||||
{
|
{
|
||||||
int fromlen = sizeof(struct sockaddr_in);
|
fromlen = sizeof(struct sockaddr_in);
|
||||||
bytes = recvfrom(sock.ipv4sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
|
bytes = recvfrom(sock.ipv4sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bytes <= 0 && sock.ipv6sock >= 0)
|
if(bytes <= 0 && sock.ipv6sock >= 0)
|
||||||
{
|
{
|
||||||
int fromlen = sizeof(struct sockaddr_in6);
|
fromlen = sizeof(struct sockaddr_in6);
|
||||||
bytes = recvfrom(sock.ipv6sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
|
bytes = recvfrom(sock.ipv6sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1596,7 +1596,7 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
|
||||||
#if defined(CONF_WEBSOCKETS)
|
#if defined(CONF_WEBSOCKETS)
|
||||||
if(bytes <= 0 && sock.web_ipv4sock >= 0)
|
if(bytes <= 0 && sock.web_ipv4sock >= 0)
|
||||||
{
|
{
|
||||||
int fromlen = sizeof(struct sockaddr);
|
fromlen = sizeof(struct sockaddr);
|
||||||
bytes = websocket_recv(sock.web_ipv4sock, data, maxsize, (struct sockaddr_in *)&sockaddrbuf, fromlen);
|
bytes = websocket_recv(sock.web_ipv4sock, data, maxsize, (struct sockaddr_in *)&sockaddrbuf, fromlen);
|
||||||
((struct sockaddr_in *)&sockaddrbuf)->sin_family = AF_WEBSOCKET_INET;
|
((struct sockaddr_in *)&sockaddrbuf)->sin_family = AF_WEBSOCKET_INET;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue