From cc56d3628f5429a9c2c97eeeee8afcf0800e3678 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 13 Jul 2008 12:43:38 -0400 Subject: [PATCH] Fixing a bug in -[SocketWrapper receive] that could miss up to the last 8 bytes of a response * Source/SocketWrapper.m: (receive): A multi-packet response could be incomplete by a difference of 8 bytes because we didn't factor in packetLength when counting --- Source/SocketWrapper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index 21c52e2..8c1cb4b 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -209,7 +209,7 @@ // check if we have a partial packet if (length + i > sizeof(buffer)) { - while (recvd < length) + while (recvd < length + i) { int latest = recv(sock, &buffer, sizeof(buffer), 0); if (latest < 1) -- 2.22.5