Merge pull request #825 from devnexen/curl_progress_fix

curl client show progress only when there actually some
This commit is contained in:
Yamagi 2022-05-07 09:44:00 +02:00 committed by GitHub
commit 22ff171007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,8 +124,10 @@ static int CL_HTTP_CurlProgressCB(void* ptr, CL_Progresstype total /* unused */,
CL_Progresstype uptotal /* unused */, CL_Progresstype upnow /* unused */)
{
dlhandle_t *dl = (dlhandle_t *)ptr;
dl->fileDownloadedSize = (size_t)now;
Com_DPrintf("CL_HTTP_CurlProgressCB: Downloaded " YQ2_COM_PRIdS "/" YQ2_COM_PRIdS "\n", dl->fileDownloadedSize, dl->fileSize);
if (now) {
dl->fileDownloadedSize = (size_t)now;
Com_DPrintf("CL_HTTP_CurlProgressCB: Downloaded " YQ2_COM_PRIdS "/" YQ2_COM_PRIdS "\n", dl->fileDownloadedSize, dl->fileSize);
}
return 0;
}