better partial message handling

This commit is contained in:
Lee Salzman
2023-07-23 21:05:47 -04:00
parent ea4607a90d
commit 2a85cd6445
3 changed files with 7 additions and 2 deletions
+3
View File
@@ -1243,6 +1243,9 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event)
& buffer,
1);
if (receivedLength == -2)
continue;
if (receivedLength < 0)
return -1;
+1 -1
View File
@@ -509,7 +509,7 @@ enet_socket_receive (ENetSocket socket,
#ifdef HAS_MSGHDR_FLAGS
if (msgHdr.msg_flags & MSG_TRUNC)
return -1;
return -2;
#endif
if (address != NULL)
+3 -1
View File
@@ -382,13 +382,15 @@ enet_socket_receive (ENetSocket socket,
case WSAEWOULDBLOCK:
case WSAECONNRESET:
return 0;
case WSAEMSGSIZE:
return -2;
}
return -1;
}
if (flags & MSG_PARTIAL)
return -1;
return -2;
if (address != NULL)
{