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:
parent
f6f8751332
commit
4efd0a9f77
|
@ -199,10 +199,10 @@ public:
|
||||||
* Returns the response body's size, or -1 if that is unknown.
|
* Returns the response body's size, or -1 if that is unknown.
|
||||||
*/
|
*/
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
int64_t GetContentLength() const noexcept {
|
curl_off_t GetContentLength() const noexcept {
|
||||||
double value;
|
curl_off_t value;
|
||||||
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD, &value)
|
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &value)
|
||||||
? (int64_t)value
|
? value
|
||||||
: -1;
|
: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue