CURLOPT_XFERINFOFUNCTION is available since libcurl 7.32.0 only.

Since it's just cosmetic, allow compiling with older libcurl, too.
fixes build on RedHat/CentOS 7

Change-Id: I169ad84d15e61012d1d38a9b41af7eef81683bf7
This commit is contained in:
JackBurton79 2018-07-27 11:20:45 +02:00 committed by Adrien Destugues
parent 08021a3beb
commit 55557aa162

View File

@ -90,12 +90,15 @@ FetchFileJob::Execute()
if (handle == NULL)
return B_NO_MEMORY;
result = curl_easy_setopt(handle, CURLOPT_NOPROGRESS, 0);
#if LIBCURL_VERSION_MAJOR > 7 \
|| (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 32)
result = curl_easy_setopt(handle, CURLOPT_NOPROGRESS, 0);
result = curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION,
&_TransferCallback);
if (result != CURLE_OK)
return B_BAD_VALUE;
result = curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION,
&_TransferCallback);
if (result != CURLE_OK)
return B_BAD_VALUE;
#endif
result = curl_easy_setopt(handle, CURLOPT_PROGRESSDATA, this);
if (result != CURLE_OK)