diff --git a/src/client/http/requestmanager/Libcurl.cpp b/src/client/http/requestmanager/Libcurl.cpp index 121c5a747..22a87dbb6 100644 --- a/src/client/http/requestmanager/Libcurl.cpp +++ b/src/client/http/requestmanager/Libcurl.cpp @@ -371,11 +371,11 @@ namespace http { #ifdef REQUEST_USE_CURL_OFFSET_T curl_off_t total, done; - HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &total)); + HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &total)); // stores -1 if unknown HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_SIZE_DOWNLOAD_T, &done)); #else double total, done; - HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &total)); + HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &total)); // stores -1 if unknown HandleCURLcode(curl_easy_getinfo(handle->curlEasy, CURLINFO_SIZE_DOWNLOAD, &done)); #endif handle->bytesTotal = int(total); @@ -383,7 +383,7 @@ namespace http } else { - handle->bytesTotal = 0; + handle->bytesTotal = -1; handle->bytesDone = 0; } } diff --git a/src/client/http/requestmanager/RequestManager.h b/src/client/http/requestmanager/RequestManager.h index c7cbb1ee9..b199e1a92 100644 --- a/src/client/http/requestmanager/RequestManager.h +++ b/src/client/http/requestmanager/RequestManager.h @@ -37,7 +37,7 @@ namespace http State state = ready; std::mutex stateMx; std::condition_variable stateCv; - std::atomic bytesTotal = 0; + std::atomic bytesTotal = -1; std::atomic bytesDone = 0; int statusCode = 0; ByteString responseData; diff --git a/src/gui/update/UpdateActivity.cpp b/src/gui/update/UpdateActivity.cpp index c75a6ab4c..e44beb58a 100644 --- a/src/gui/update/UpdateActivity.cpp +++ b/src/gui/update/UpdateActivity.cpp @@ -42,7 +42,14 @@ private: { int total, done; std::tie(total, done) = request->CheckProgress(); - notifyProgress(total ? done * 100 / total : 0); + if (total == -1) + { + notifyProgress(-1); + } + else + { + notifyProgress(total ? done * 100 / total : 0); + } Platform::Millisleep(1); }