Commit 4efd0a9f authored by Max Kellermann's avatar Max Kellermann

lib/curl/Easy: use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T

CURLINFO_CONTENT_LENGTH_DOWNLOAD is deprecated and is ugly because it uses floating point.
parent f6f87513
......@@ -199,10 +199,10 @@ public:
* Returns the response body's size, or -1 if that is unknown.
*/
[[gnu::pure]]
int64_t GetContentLength() const noexcept {
double value;
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD, &value)
? (int64_t)value
curl_off_t GetContentLength() const noexcept {
curl_off_t value;
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &value)
? value
: -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment