mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
http: Skip processing response body for void.
No need to decompress or copy between buffers.
This commit is contained in:
1 parent
20443571bd
commit
1459c16fb8
4 files changed
+29
-18
No files matched your search
+17
-15
@@ -432,23 +432,25 @@ int Client::ReadResponseEntity(net::Buffer *readbuf, const std::vector<std::stri
|
||||
}
|
||||
|
||||
// output now contains the rest of the reply. Dechunk it.
|
||||
if (chunked) {
|
||||
DeChunk(readbuf, output, contentLength, &progress->progress);
|
||||
} else {
|
||||
output->Append(*readbuf);
|
||||
}
|
||||
if (!output->IsVoid()) {
|
||||
if (chunked) {
|
||||
DeChunk(readbuf, output, contentLength, &progress->progress);
|
||||
} else {
|
||||
output->Append(*readbuf);
|
||||
}
|
||||
|
||||
// If it's gzipped, we decompress it and put it back in the buffer.
|
||||
if (gzip) {
|
||||
std::string compressed, decompressed;
|
||||
output->TakeAll(&compressed);
|
||||
bool result = decompress_string(compressed, &decompressed);
|
||||
if (!result) {
|
||||
ERROR_LOG(IO, "Error decompressing using zlib");
|
||||
progress->progress = 0.0f;
|
||||
return -1;
|
||||
// If it's gzipped, we decompress it and put it back in the buffer.
|
||||
if (gzip) {
|
||||
std::string compressed, decompressed;
|
||||
output->TakeAll(&compressed);
|
||||
bool result = decompress_string(compressed, &decompressed);
|
||||
if (!result) {
|
||||
ERROR_LOG(IO, "Error decompressing using zlib");
|
||||
progress->progress = 0.0f;
|
||||
return -1;
|
||||
}
|
||||
output->Append(decompressed);
|
||||
}
|
||||
output->Append(decompressed);
|
||||
}
|
||||
|
||||
progress->progress = 1.0f;
|
||||
|
||||
Reference in new issue
Block a user