From 8d11766fca058ad4be3340064aa16e9f6c14a6e3 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 434c1ad..d904264 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -204,7 +204,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.43.5