, _minChunkSize(1 * 1000 * 1000) // 1 MB
, _maxChunkSize(100 * 1000 * 1000) // 100 MB
, _targetChunkUploadDuration(60 * 1000) // 1 minute
+ , _parallelNetworkJobs(true)
{
}
* Set to 0 it will disable dynamic chunk sizing.
*/
quint64 _targetChunkUploadDuration;
+
+ /** Whether parallel network jobs are allowed. */
+ bool _parallelNetworkJobs;
};
int OwncloudPropagator::maximumActiveTransferJob()
{
- if (_downloadLimit.fetchAndAddAcquire(0) != 0 || _uploadLimit.fetchAndAddAcquire(0) != 0) {
+ if (_downloadLimit.fetchAndAddAcquire(0) != 0
+ || _uploadLimit.fetchAndAddAcquire(0) != 0
+ || !_syncOptions._parallelNetworkJobs) {
// disable parallelism when there is a network limit.
return 1;
}
/* The maximum number of active jobs in parallel */
int OwncloudPropagator::hardMaximumActiveJob()
{
+ if (!_syncOptions._parallelNetworkJobs)
+ return 1;
static int max = qgetenv("OWNCLOUD_MAX_PARALLEL").toUInt();
if (max)
return max;