From c34071d05c28039862246568e4b377d792a35048 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 7 May 2022 07:03:40 +0100 Subject: [PATCH] curl client show progress only when there actually some --- src/client/curl/download.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/curl/download.c b/src/client/curl/download.c index 9c8bb616..117909dc 100644 --- a/src/client/curl/download.c +++ b/src/client/curl/download.c @@ -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; }