From 14f7e1fc42e0cffd16a943c8221fdc67224dae5e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Oct 2015 13:15:21 +0200 Subject: [PATCH] Revert to CURLOPT_PROGRESSFUNCTION CURLOPT_XFERINFOFUNCTION isn't widely supported yet. http://hydra.nixos.org/build/26679495 --- src/libstore/download.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libstore/download.cc b/src/libstore/download.cc index 727d9fc8b..c6c2f6115 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -70,7 +70,7 @@ struct Curl return realSize; } - int xferInfoCallback(curl_off_t dltotal, curl_off_t dlnow) + int progressCallback(double dltotal, double dlnow) { if (showProgress) { double now = getTime(); @@ -88,10 +88,10 @@ struct Curl return _isInterrupted; } - static int xferInfoCallback_(void * userp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) + static int progressCallback_(void * userp, double dltotal, double dlnow, double ultotal, double ulnow) { Curl & c(* (Curl *) userp); - return c.xferInfoCallback(dltotal, dlnow); + return c.progressCallback(dltotal, dlnow); } Curl() @@ -112,8 +112,8 @@ struct Curl curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, headerCallback); curl_easy_setopt(curl, CURLOPT_HEADERDATA, (void *) &curl); - curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferInfoCallback_); - curl_easy_setopt(curl, CURLOPT_XFERINFODATA, (void *) &curl); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressCallback_); + curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, (void *) &curl); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); showProgress = isatty(STDERR_FILENO);