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:
committed by
Adrien Destugues
parent
08021a3beb
commit
55557aa162
@@ -90,12 +90,15 @@ FetchFileJob::Execute()
|
|||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
return B_NO_MEMORY;
|
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,
|
result = curl_easy_setopt(handle, CURLOPT_XFERINFOFUNCTION,
|
||||||
&_TransferCallback);
|
&_TransferCallback);
|
||||||
if (result != CURLE_OK)
|
if (result != CURLE_OK)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
result = curl_easy_setopt(handle, CURLOPT_PROGRESSDATA, this);
|
result = curl_easy_setopt(handle, CURLOPT_PROGRESSDATA, this);
|
||||||
if (result != CURLE_OK)
|
if (result != CURLE_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user