CURL - The use of CURLINFO_SIZE_DOWNLOAD and CURLINFO_SPEED_DOWNLOAD has been deprecated since curl version 7.55 (2017). The respective replacements are CURLINFO_SIZE_DOWNLOAD_T and CURLINFO_SPEED_DOWNLOAD_T. Please see https://curl.se/libcurl/c/CURLINFO_SIZE_DOWNLOAD_T.html and https://curl.se/libcurl/c/CURLINFO_SPEED_DOWNLOAD_T.html for more information. CURLINFO_SIZE_DOWNLOAD_T and CURLINFO_SPEED_DOWNLOAD_T are NOT something new; the LL implementation of how curl is being used is just old... This commit will correct the deprecation warnings when compiling with newer versions of curl on Linux. In 10 years time when LL finally update curl and openssl for the other platforms, this commit can probably go away.

master
Pork Chop 2023-10-02 22:38:54 +11:00
parent ef373cc849
commit 3be882c1c6
2 changed files with 13 additions and 1 deletions

View File

@ -272,10 +272,15 @@ void HttpOpRequest::visitNotifier(HttpRequest * request)
HttpResponse::TransferStats::ptr_t stats = HttpResponse::TransferStats::ptr_t(new HttpResponse::TransferStats);
#if LL_LINUX
curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_DOWNLOAD_T, &stats->mSizeDownload);
curl_easy_getinfo(mCurlHandle, CURLINFO_TOTAL_TIME, &stats->mTotalTime);
curl_easy_getinfo(mCurlHandle, CURLINFO_SPEED_DOWNLOAD_T, &stats->mSpeedDownload);
#else
curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_DOWNLOAD, &stats->mSizeDownload);
curl_easy_getinfo(mCurlHandle, CURLINFO_TOTAL_TIME, &stats->mTotalTime);
curl_easy_getinfo(mCurlHandle, CURLINFO_SPEED_DOWNLOAD, &stats->mSpeedDownload);
#endif
response->setTransferStats(stats);
mUserHandler->onCompleted(this->getHandle(), response);

View File

@ -75,9 +75,16 @@ public:
typedef boost::shared_ptr<TransferStats> ptr_t;
TransferStats() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {}
#if LL_LINUX
curl_off_t mSizeDownload;
curl_off_t mSpeedDownload;
F64 mTotalTime;
#else
F64 mSizeDownload;
F64 mTotalTime;
F64 mSpeedDownload;
#endif
};