From dfe945710ddb8da709535e934c9caa676afddabe Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 25 Sep 2021 23:26:38 -0700 Subject: [PATCH] http: Fix timeout mid request. Sometimes we think a socket is ready, and it isn't. We shouldn't fail the whole read just because of this. --- Common/Net/NetBuffer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Common/Net/NetBuffer.cpp b/Common/Net/NetBuffer.cpp index 331f24b55e..4309f18d05 100644 --- a/Common/Net/NetBuffer.cpp +++ b/Common/Net/NetBuffer.cpp @@ -73,12 +73,16 @@ bool Buffer::ReadAllWithProgress(int fd, int knownSize, float *progress, float * return true; } else if (retval < 0) { #if PPSSPP_PLATFORM(WINDOWS) - if (WSAGetLastError() != WSAEWOULDBLOCK) + if (WSAGetLastError() != WSAEWOULDBLOCK) { #else - if (errno != EWOULDBLOCK) + if (errno != EWOULDBLOCK) { #endif ERROR_LOG(IO, "Error reading from buffer: %i", retval); - return false; + return false; + } + + // Just try again on a would block error, not a real error. + continue; } char *p = Append((size_t)retval); memcpy(p, &buf[0], retval);