VirtualBox

Changeset 73834 in vbox


Ignore:
Timestamp:
Aug 22, 2018 3:51:01 PM (6 years ago)
Author:
vboxsync
Message:

http-curl.cpp: Use new CURLOPT_XFERINFOFUNCTION instead of old
deprecated CURLOPT_PROGRESSFUNCTION. The new one has integer
curl_off_t parameters instead of double. We are quite unlikely to run
into lost precision when converting from double, but it feels cleaner.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r73832 r73834  
    21792179 * cURL callback for reporting progress, we use it for checking for abort.
    21802180 */
    2181 static int rtHttpProgress(void *pData, double rdTotalDownload, double rdDownloaded, double rdTotalUpload, double rdUploaded)
     2181static int rtHttpProgress(void *pData,
     2182                          curl_off_t rdTotalDownload, curl_off_t rdDownloaded,
     2183                          curl_off_t rdTotalUpload, curl_off_t rdUploaded)
    21822184{
    21832185    PRTHTTPINTERNAL pThis = (PRTHTTPINTERNAL)pData;
     
    22572259     * Progress/abort.
    22582260     */
    2259     rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROGRESSFUNCTION, &rtHttpProgress);
     2261    rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_XFERINFOFUNCTION, &rtHttpProgress);
    22602262    if (CURL_FAILURE(rcCurl))
    22612263        return VERR_HTTP_CURL_ERROR;
    2262     rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROGRESSDATA, (void *)pThis);
     2264    rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_XFERINFODATA, (void *)pThis);
    22632265    if (CURL_FAILURE(rcCurl))
    22642266        return VERR_HTTP_CURL_ERROR;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette