UploadNG: Avoid div-by-zero for super fast uploads

This commit is contained in:
Christian Kamm 2017-09-25 11:38:42 +02:00 committed by ckamm
parent e10775d34f
commit 111bb485ec

View file

@ -365,7 +365,7 @@ void PropagateUploadFileNG::slotPutFinished()
// target duration for each chunk upload.
double targetDuration = propagator()->syncOptions()._targetChunkUploadDuration;
if (targetDuration > 0) {
double uploadTime = job->msSinceStart();
double uploadTime = job->msSinceStart() + 1; // add one to avoid div-by-zero
auto predictedGoodSize = static_cast<quint64>(
_currentChunkSize / uploadTime * targetDuration);