Merge pull request #1037 from sa5bke/master

support curl version < 7.32.0, i.e. rhel/centos 7
This commit is contained in:
Alexander Bock
2020-01-11 20:21:52 +01:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -187,8 +187,12 @@ std::shared_ptr<DownloadManager::FileFuture> DownloadManager::downloadFile(
std::chrono::system_clock::now(),
&progressCb
};
#if LIBCURL_VERSION_NUM >= 0x072000
// xferinfo was introduced in 7.32.0, if a lower curl version is used the progress
// will not be shown for downloads on the splash screen
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, xferinfo); // NOLINT
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &p); // NOLINT
#endif
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); // NOLINT
CURLcode res = curl_easy_perform(curl);
+4
View File
@@ -124,9 +124,13 @@ void HttpRequest::perform(RequestOptions opt) {
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlfunctions::writeCallback);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); // NOLINT
#if LIBCURL_VERSION_NUM >= 0x072000
// xferinfo was introduced in 7.32.0, if a lower curl version is used the progress
// will not be shown for downloads on the splash screen
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this); // NOLINT
// NOLINTNEXTLINE
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, curlfunctions::progressCallback);
#endif
if (opt.requestTimeoutSeconds > 0) {
curl_easy_setopt(curl, CURLOPT_TIMEOUT, opt.requestTimeoutSeconds); // NOLINT