aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-10 17:08:49 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-10 17:08:49 -0500
commiteefa488da7292876f93e952af09638b8cca81ef2 (patch)
treefa6855e15336ef8258e5c7586280936145fe7c51 /src
parentc9599410b1bd5492c723b3a2e6017ebc6f48a358 (diff)
Fix SLR download silently failing due to response data being discarded
The readyRead handler consumed data via readAll() but discarded it when no destination file was set. The final readAll() then returned empty since the buffer was already drained, causing all in-memory HTTP responses (like BUILD_ID.txt) to appear empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src')
-rw-r--r--src/src/slrmanager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/src/slrmanager.cpp b/src/src/slrmanager.cpp
index 4e7b898..fe60e56 100644
--- a/src/src/slrmanager.cpp
+++ b/src/src/slrmanager.cpp
@@ -47,6 +47,7 @@ QByteArray httpGet(const QString& url, const int* cancelFlag,
return {};
}
+ QByteArray inMemoryBuf;
qint64 totalBytes = -1;
qint64 received = 0;
@@ -57,6 +58,8 @@ QByteArray httpGet(const QString& url, const int* cancelFlag,
received += chunk.size();
if (outFile.isOpen())
outFile.write(chunk);
+ else
+ inMemoryBuf.append(chunk);
if (progressCb && totalBytes > 0)
progressCb(static_cast<float>(received) / static_cast<float>(totalBytes));
});
@@ -87,11 +90,8 @@ QByteArray httpGet(const QString& url, const int* cancelFlag,
return {};
}
- QByteArray body;
- if (destFile.isEmpty())
- body = reply->readAll(); // small responses fully buffered
reply->deleteLater();
- return body;
+ return inMemoryBuf;
}
} // namespace