diff options
author | Lee Salzman <[email protected]> | 2023-07-23 21:05:47 -0400 |
---|---|---|
committer | Lee Salzman <[email protected]> | 2023-07-23 21:05:47 -0400 |
commit | 2a85cd64459f6ba038d233a634d9440490dbba12 (patch) | |
tree | 357ac6030b33ea1fc05ba5fea8ee7ea8b76a2808 | |
parent | ea4607a90dbfbcf4da2669ea998585253d8e70b1 (diff) | |
download | enet-2a85cd64459f6ba038d233a634d9440490dbba12.tar.gz enet-2a85cd64459f6ba038d233a634d9440490dbba12.zip |
better partial message handling
-rw-r--r-- | protocol.c | 3 | ||||
-rw-r--r-- | unix.c | 2 | ||||
-rw-r--r-- | win32.c | 4 |
3 files changed, 7 insertions, 2 deletions
@@ -1243,6 +1243,9 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) & buffer, 1); + if (receivedLength == -2) + continue; + if (receivedLength < 0) return -1; @@ -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) @@ -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) { |