search for: curle_ok

Displaying 1 result from an estimated 1 matches for "curle_ok".

2020 Jan 08
1
[nbdkit PATCH] curl: use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T when available
...GTH_DOWNLOAD_T + curl_off_t o; +#endif h = calloc (1, sizeof *h); if (h == NULL) { @@ -377,6 +384,21 @@ curl_open (int readonly) goto err; } +#ifdef HAVE_CURLINFO_CONTENT_LENGTH_DOWNLOAD_T + r = curl_easy_getinfo (h->c, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &o); + if (r != CURLE_OK) { + display_curl_error (h, r, "could not get length of remote file [%s]", url); + goto err; + } + + if (o == -1) { + nbdkit_error ("could not get length of remote file [%s], " + "is the URL correct?", url); + goto err; + } + + h->ex...