Fix package download progress computation.
The download progress and total used to be doubles, but now they are off_t. This resulted in the division being done in integers, and always getting 0 as the result. Fixes #11940.
This commit is contained in:
@@ -139,7 +139,7 @@ FetchFileJob::_TransferCallback(void* _job, off_t downloadTotal,
|
|||||||
if (downloadTotal != 0) {
|
if (downloadTotal != 0) {
|
||||||
job->fBytes = downloaded;
|
job->fBytes = downloaded;
|
||||||
job->fTotalBytes = downloadTotal;
|
job->fTotalBytes = downloadTotal;
|
||||||
job->fDownloadProgress = downloaded / downloadTotal;
|
job->fDownloadProgress = (float)downloaded / downloadTotal;
|
||||||
job->NotifyStateListeners();
|
job->NotifyStateListeners();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user