From 1144ac4fd38282bac92740f831fe649c94358dad Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 2 Jun 2025 17:30:59 +0200 Subject: [PATCH] fix(get/file): avoid failing to download files under 20 MiB if a file that uncompresses to a file size under 10 MiB, Qt will allow it for files with an higher size, they must not have higher compression ratio than what Qt network stack expect https://doc.qt.io/qt-6/qnetworkrequest.html#setDecompressedSafetyCheckThreshold we will use a 2 times bigger threshold Close https://github.com/nextcloud/desktop/issues/7470 Signed-off-by: Matthieu Gallien --- src/libsync/propagatedownload.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 710208eea6..94ba15a09c 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -29,6 +29,8 @@ namespace OCC { +static constexpr auto CustomDecompressedSafetyCheckThreshold = 20 * 1024 * 1024; + Q_LOGGING_CATEGORY(lcGetJob, "nextcloud.sync.networkjob.get", QtInfoMsg) Q_LOGGING_CATEGORY(lcPropagateDownload, "nextcloud.sync.propagator.download", QtInfoMsg) @@ -114,6 +116,7 @@ void GETFileJob::start() } req.setPriority(QNetworkRequest::LowPriority); // Long downloads must not block non-propagation jobs. + req.setDecompressedSafetyCheckThreshold(CustomDecompressedSafetyCheckThreshold); if (_directDownloadUrl.isEmpty()) { sendRequest("GET", makeDavUrl(path()), req);