From: Ingo Ruhnke Date: Wed, 27 Aug 2014 21:26:25 +0000 (+0200) Subject: Switched from CURLOPT_XFERINFOFUNCTION back to CURLOPT_PROGRESSFUNCTION, since some... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4b0d6bca7ead45c1ffe5a07f30c10ea5ae227918;p=supertux.git Switched from CURLOPT_XFERINFOFUNCTION back to CURLOPT_PROGRESSFUNCTION, since some old cURL versions don't support the former --- diff --git a/src/addon/downloader.cpp b/src/addon/downloader.cpp index 80a55757c..c10bea464 100644 --- a/src/addon/downloader.cpp +++ b/src/addon/downloader.cpp @@ -111,8 +111,8 @@ public: curl_easy_setopt(m_handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(m_handle, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(m_handle, CURLOPT_XFERINFODATA, this); - curl_easy_setopt(m_handle, CURLOPT_XFERINFOFUNCTION, &Transfer::on_progress_wrap); + curl_easy_setopt(m_handle, CURLOPT_PROGRESSDATA, this); + curl_easy_setopt(m_handle, CURLOPT_PROGRESSFUNCTION, &Transfer::on_progress_wrap); } } @@ -152,14 +152,14 @@ public: return size * nmemb; } - void on_progress(curl_off_t dltotal, curl_off_t dlnow, - curl_off_t ultotal, curl_off_t ulnow) + void on_progress(double dltotal, double dlnow, + double ultotal, double ulnow) { - m_status->dltotal = dltotal; - m_status->dlnow = dlnow; + m_status->dltotal = static_cast(dltotal); + m_status->dlnow = static_cast(dlnow); - m_status->ultotal = ultotal; - m_status->ulnow = ulnow; + m_status->ultotal = static_cast(ultotal); + m_status->ulnow = static_cast(ulnow); } private: @@ -169,8 +169,8 @@ private: } static void on_progress_wrap(void* userdata, - curl_off_t dltotal, curl_off_t dlnow, - curl_off_t ultotal, curl_off_t ulnow) + double dltotal, double dlnow, + double ultotal, double ulnow) { return static_cast(userdata)->on_progress(dltotal, dlnow, ultotal, ulnow); }