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.
|
||||
*/
|
||||
[[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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue