From eefa488da7292876f93e952af09638b8cca81ef2 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Fri, 10 Apr 2026 17:08:49 -0500 Subject: 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) --- src/src/slrmanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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(received) / static_cast(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 -- cgit v1.3.1