diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp index ca72a70bb..6bf352f9a 100644 --- a/src/libsync/capabilities.cpp +++ b/src/libsync/capabilities.cpp @@ -107,4 +107,10 @@ QByteArray Capabilities::uploadChecksumType() const return QByteArray(); } +bool Capabilities::chunkingNg() const +{ + return _capabilities["dav"].toMap()["chunking"].toByteArray() >= "1.0"; +} + + } diff --git a/src/libsync/capabilities.h b/src/libsync/capabilities.h index 04eef6e39..5f1936aba 100644 --- a/src/libsync/capabilities.h +++ b/src/libsync/capabilities.h @@ -39,6 +39,7 @@ public: bool sharePublicLinkEnforceExpireDate() const; int sharePublicLinkExpireDateDays() const; bool shareResharing() const; + bool chunkingNg() const; /// returns true if the capabilities report notifications bool notificationsAvailable() const; diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index eace8e35d..1302f88a7 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -270,9 +270,10 @@ PropagateItemJob* OwncloudPropagator::createJob(const SyncFileItemPtr &item) { job->setDeleteExistingFolder(deleteExisting); return job; } else { - static const bool isNg = !qgetenv("OWNCLOUD_CHUNK_NG").isEmpty(); // FIXME! use server version PropagateUploadFileCommon *job = 0; - if (isNg && item->_size > chunkSize()) { + static const auto chunkng = qgetenv("OWNCLOUD_CHUNKING_NG"); + if (item->_size > chunkSize() + && (account()->capabilities().chunkingNg() || chunkng == "1") && chunkng != "0") { job = new PropagateUploadFileNG(this, item); } else { job = new PropagateUploadFileV1(this, item);