From 6d9ff8fac47ae8861a622c4cb729b0f25ded72ef Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 25 Nov 2014 00:33:23 -0800 Subject: [PATCH] Fix disconnect order. --- Core/Loaders.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index 07181e1796..f40a6b3d12 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -342,13 +342,13 @@ size_t HTTPFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data) { Buffer output; client_.ReadResponseEntity(&readbuf, responseHeaders, &output); + client_.Disconnect(); + if (!supportedResponse) { ERROR_LOG(LOADER, "HTTP server did not respond with the range we wanted."); return 0; } - client_.Disconnect(); - size_t readBytes = output.size(); output.Take(readBytes, (char *)data); filepos_ = absolutePos + readBytes;