Skip to content

Commit

Permalink
Merge pull request #1640 from cyrossignol/fix-curl-type
Browse files Browse the repository at this point in the history
Change Curl download speed type to support older environments
  • Loading branch information
jamescowens committed Feb 15, 2020
2 parents 1f30481 + d518960 commit a0070d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scraper/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ namespace
{
pg->lastruntime = currenttime;

curl_off_t speed;
double speed;
CURLcode result;

result = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed);
result = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed);

// Download speed update
if (result == CURLE_OK)
{

#if LIBCURL_VERSION_NUM >= 0x073700
if (speed > 0)
DownloadStatus.SnapshotDownloadSpeed = speed;
DownloadStatus.SnapshotDownloadSpeed = (int64_t)speed;

else {
DownloadStatus.SnapshotDownloadSpeed = 0;
Expand Down

0 comments on commit a0070d8

Please sign in to comment.