mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Chunking-NG: Enable if the server supports it
This commit is contained in:
parent
273590fdfc
commit
e33b89c222
3 changed files with 10 additions and 2 deletions
|
@ -107,4 +107,10 @@ QByteArray Capabilities::uploadChecksumType() const
|
|||
return QByteArray();
|
||||
}
|
||||
|
||||
bool Capabilities::chunkingNg() const
|
||||
{
|
||||
return _capabilities["dav"].toMap()["chunking"].toByteArray() >= "1.0";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue