From 111bb485ecfce64244282b91a207dab07dc96b63 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 25 Sep 2017 11:38:42 +0200 Subject: [PATCH] UploadNG: Avoid div-by-zero for super fast uploads --- src/libsync/propagateuploadng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index f8873654f..fa16a4abe 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -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( _currentChunkSize / uploadTime * targetDuration);