diff options
Diffstat (limited to 'src/wx/Platform.cpp')
-rw-r--r-- | src/wx/Platform.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wx/Platform.cpp b/src/wx/Platform.cpp index 12145f3..95da1bc 100644 --- a/src/wx/Platform.cpp +++ b/src/wx/Platform.cpp @@ -134,7 +134,9 @@ int MP_SendPacket(u8* data, int len) *(u16*)&PacketBuffer[6] = htons(len); memcpy(&PacketBuffer[8], data, len); - return sendto(MPSocket, (const char*)PacketBuffer, len+8, 0, &MPSendAddr, sizeof(sockaddr_t)); + int slen = sendto(MPSocket, (const char*)PacketBuffer, len+8, 0, &MPSendAddr, sizeof(sockaddr_t)); + if (slen < 8) return 0; + return slen - 8; } int MP_RecvPacket(u8* data, bool block) @@ -174,7 +176,6 @@ int MP_RecvPacket(u8* data, bool block) return 0; } - rlen -= 8; if (ntohs(*(u16*)&PacketBuffer[6]) != rlen) { return 0; |