diff --git a/Source/Core/Common/HttpRequest.cpp b/Source/Core/Common/HttpRequest.cpp index a8ed0d26ed..b9c6756624 100644 --- a/Source/Core/Common/HttpRequest.cpp +++ b/Source/Core/Common/HttpRequest.cpp @@ -33,8 +33,8 @@ public: Response Fetch(const std::string& url, Method method, const Headers& headers, const u8* payload, size_t size, AllowedReturnCodes codes = AllowedReturnCodes::Ok_Only); - static int CurlProgressCallback(Impl* impl, double dlnow, double dltotal, double ulnow, - double ultotal); + static int CurlProgressCallback(Impl* impl, curl_off_t dltotal, curl_off_t dlnow, + curl_off_t ultotal, curl_off_t ulnow); std::string EscapeComponent(const std::string& string); private: @@ -95,11 +95,12 @@ HttpRequest::Response HttpRequest::Post(const std::string& url, const std::strin reinterpret_cast(payload.data()), payload.size(), codes); } -int HttpRequest::Impl::CurlProgressCallback(Impl* impl, double dlnow, double dltotal, double ulnow, - double ultotal) +int HttpRequest::Impl::CurlProgressCallback(Impl* impl, curl_off_t dltotal, curl_off_t dlnow, + curl_off_t ultotal, curl_off_t ulnow) { // Abort if callback isn't true - return !impl->m_callback(dlnow, dltotal, ulnow, ultotal); + return !impl->m_callback(static_cast(dltotal), static_cast(dlnow), + static_cast(ultotal), static_cast(ulnow)); } HttpRequest::Impl::Impl(std::chrono::milliseconds timeout_ms, ProgressCallback callback) @@ -116,7 +117,7 @@ HttpRequest::Impl::Impl(std::chrono::milliseconds timeout_ms, ProgressCallback c if (m_callback) { curl_easy_setopt(m_curl.get(), CURLOPT_PROGRESSDATA, this); - curl_easy_setopt(m_curl.get(), CURLOPT_PROGRESSFUNCTION, CurlProgressCallback); + curl_easy_setopt(m_curl.get(), CURLOPT_XFERINFOFUNCTION, CurlProgressCallback); } // Set up error buffer diff --git a/Source/Core/Common/HttpRequest.h b/Source/Core/Common/HttpRequest.h index 921051c9c2..17b9fd3413 100644 --- a/Source/Core/Common/HttpRequest.h +++ b/Source/Core/Common/HttpRequest.h @@ -25,8 +25,7 @@ public: }; // Return false to abort the request - using ProgressCallback = - std::function; + using ProgressCallback = std::function; explicit HttpRequest(std::chrono::milliseconds timeout_ms = std::chrono::milliseconds{3000}, ProgressCallback callback = nullptr); diff --git a/Source/Core/UpdaterCommon/UpdaterCommon.cpp b/Source/Core/UpdaterCommon/UpdaterCommon.cpp index 408c313c95..9dd40c679f 100644 --- a/Source/Core/UpdaterCommon/UpdaterCommon.cpp +++ b/Source/Core/UpdaterCommon/UpdaterCommon.cpp @@ -58,7 +58,7 @@ void LogToFile(const char* fmt, ...) va_end(args); } -bool ProgressCallback(double total, double now, double, double) +bool ProgressCallback(s64 total, s64 now, s64, s64) { UI::SetCurrentProgress(static_cast(now), static_cast(total)); return true;