Skip to content

Commit 72ea360

Browse files
committed
fix(libsync): add OWNCLOUD_BULK_UPLOAD env override to force-disable bulk upload
Mirrors the existing OWNCLOUD_CHUNKING_NG override pattern in the same file. Bulk upload (POST .../dav/bulk) is enabled automatically whenever the server advertises the dav.bulkupload capability, with no client-side way to opt out if that endpoint is broken or blocked somewhere in the network path (reverse proxy, WAF, etc). Observed against a self-hosted Nextcloud instance where every single bulk-upload POST failed immediately with UnknownNetworkError, while regular per-file uploads succeeded without issue. Because the failure is deterministic and the client re-attempts bulk upload from scratch on every sync invocation (the in-memory per-file blacklist does not survive across the max-sync-retries restarts, let alone separate nextcloudcmd invocations), affected files never converge and the sync stays permanently red for that server. Setting OWNCLOUD_BULK_UPLOAD=0 lets an operator route around a broken bulk endpoint without needing a custom build, matching the escape hatch already available for chunking via OWNCLOUD_CHUNKING_NG.
1 parent 7c3179d commit 72ea360

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libsync/capabilities.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ int Capabilities::maxConcurrentChunkUploads() const
250250

251251
bool Capabilities::bulkUpload() const
252252
{
253+
static const auto bulkUploadEnv = qgetenv("OWNCLOUD_BULK_UPLOAD");
254+
if (bulkUploadEnv == "0")
255+
return false;
256+
if (bulkUploadEnv == "1")
257+
return true;
253258
return _capabilities["dav"].toMap()["bulkupload"].toByteArray() >= "1.0";
254259
}
255260

0 commit comments

Comments
 (0)