Skip to content

Commit

Permalink
Disable parallel uploads for server versions <= 8.0.2
Browse files Browse the repository at this point in the history
Issue #2938
  • Loading branch information
ogoffart committed Mar 11, 2015
1 parent 1ca6814 commit 4a01644
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/libsync/propagateupload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,18 +422,14 @@ void PropagateUploadFileQNAM::startNextChunk()
parallelChunkUpload = env != "false" && env != "0";
} else {
auto version = _propagator->account()->serverVersion();
auto dotPos = version.indexOf('.');
if (dotPos > 0) {
if (version.leftRef(dotPos)
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
.toString() // QStringRef::toInt was added in Qt 5.1
#endif
.toInt() < 8) {

// Disable parallel chunk upload on older sever to avoid too many
// internal sever errors (#2743)
parallelChunkUpload = false;
}
auto components = version.split('.');
int versionNum = (components.value(0).toInt() << 16)
+ (components.value(1).toInt() << 8)
+ components.value(2).toInt();
if (versionNum < 0x080003) {
// Disable parallel chunk upload severs older than 8.0.3 to avoid too many
// internal sever errors (#2743, #2938)
parallelChunkUpload = false;
}
}

Expand Down

0 comments on commit 4a01644

Please sign in to comment.