lib/curl/Easy: use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T

CURLINFO_CONTENT_LENGTH_DOWNLOAD is deprecated and is ugly because it
uses floating point.
This commit is contained in:
Max Kellermann 2022-12-31 07:59:39 +01:00
parent f6f8751332
commit 4efd0a9f77
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}