1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Make sure data sent out over wire is advanced properly (#3844)

This commit is contained in:
Michał Janiszewski
2016-06-09 13:29:44 +02:00
committed by Ted John
parent cfc40c3f22
commit 4b152bac88

View File

@@ -349,7 +349,9 @@ public:
size_t totalSent = 0;
do
{
int sentBytes = send(_socket, (const char *)buffer, (int)size, FLAG_NO_PIPE);
const char * bufferStart = (const char *)buffer + totalSent;
size_t remainingSize = size - totalSent;
int sentBytes = send(_socket, (const char *)bufferStart, (int)remainingSize, FLAG_NO_PIPE);
if (sentBytes == SOCKET_ERROR)
{
return false;