mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
allow compilation against older libcurl versions
This commit is contained in:
parent
e212e8d9bb
commit
5bb7404cd8
1 changed files with 7 additions and 2 deletions
|
@ -105,6 +105,7 @@ static char * advio_human_size(double s, char *buf, size_t len)
|
|||
return buf;
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x072000
|
||||
static int advio_xferinfo(void *p, curl_off_t dl_total_bytes, curl_off_t dl_bytes, curl_off_t ul_total_bytes, curl_off_t ul_bytes)
|
||||
{
|
||||
struct advio *af = (struct advio *) p;
|
||||
|
@ -168,6 +169,7 @@ static int advio_xferinfo(void *p, curl_off_t dl_total_bytes, curl_off_t dl_byte
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* LIBCURL_VERSION_NUM >= 0x072000 */
|
||||
|
||||
int aislocal(const char *uri)
|
||||
{
|
||||
|
@ -236,8 +238,11 @@ AFILE * afopen(const char *uri, const char *mode)
|
|||
curl_easy_setopt(af->curl, CURLOPT_DEBUGFUNCTION, advio_trace);
|
||||
curl_easy_setopt(af->curl, CURLOPT_VERBOSE, 1);
|
||||
|
||||
curl_easy_setopt(af->curl, CURLOPT_XFERINFOFUNCTION, advio_xferinfo);
|
||||
curl_easy_setopt(af->curl, CURLOPT_XFERINFODATA, af);
|
||||
/* CURLOPT_XFERINFOFUNCTION is only supported on libcurl >= 7.32.0 */
|
||||
#if LIBCURL_VERSION_NUM >= 0x072000
|
||||
curl_easy_setopt(af->curl, CURLOPT_XFERINFOFUNCTION, advio_xferinfo);
|
||||
curl_easy_setopt(af->curl, CURLOPT_XFERINFODATA, af);
|
||||
#endif
|
||||
|
||||
ret = adownload(af, 0);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue