aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-08 13:15:21 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-08 13:15:21 +0200
commit14f7e1fc42e0cffd16a943c8221fdc67224dae5e (patch)
tree117b3b0a476935049ee56cef320cdee7b22e1bef /src
parent21ecd106edff6d97a0241b75b3d07d81bdb5cdfe (diff)
Revert to CURLOPT_PROGRESSFUNCTION
CURLOPT_XFERINFOFUNCTION isn't widely supported yet. http://hydra.nixos.org/build/26679495
Diffstat (limited to 'src')
-rw-r--r--src/libstore/download.cc10
1 files 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);