diff --git a/src/network/TcpSocket.cpp b/src/network/TcpSocket.cpp index 8ff9f876a6..3e3350a729 100644 --- a/src/network/TcpSocket.cpp +++ b/src/network/TcpSocket.cpp @@ -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;