VirtualBox

Changeset 74091 in vbox


Ignore:
Timestamp:
Sep 5, 2018 5:58:31 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/http: New read/write callbacks APIs (untested). bugref:9167 [build fix]

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/http.h

    r74090 r74091  
    464464 *          call this method for different status codes.  Only the last one
    465465 *          with be honored.
     466 *
     467 * @note    This only works reliably with RTHttpPerform at the moment.
    466468 */
    467469RTR3DECL(int) RTHttpSetDownloadCallback(RTHTTP hHttp, uint32_t fFlags, PFNRTHTTPDOWNLOADCALLBACK pfnCallback, void *pvUser);
     
    501503 * @param   pfnCallback     The callback function.  Pass NULL to reset the callback.
    502504 * @param   pvUser          Convenience pointer for the callback function.
     505 *
     506 * @note    This only works reliably with RTHttpPerform at the moment.
    503507 */
    504508RTR3DECL(int) RTHttpSetUploadCallback(RTHTTP hHttp, uint64_t cbContent, PFNRTHTTPUPLOADCALLBACK pfnCallback, void *pvUser);
     
    528532 * @param   pfnCallback     The callback function.  Pass NULL to reset the callback.
    529533 * @param   pvUser          Convenience pointer for the callback function.
     534 *
     535 * @note    This only works reliably with RTHttpPerform at the moment.
    530536 */
    531537RTR3DECL(int) RTHttpSetHeaderCallback(RTHTTP hHttp, PFNRTHTTPHEADERCALLBACK pfnCallback, void *pvUser);
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r74090 r74091  
    28592859
    28602860
     2861/**
     2862 * Tries to determin uDownloadHttpStatus and cbDownloadContent.
     2863 *
     2864 * @param   pThis        HTTP client instance.
     2865 */
    28612866static void rtHttpGetDownloadStatusAndLength(PRTHTTPINTERNAL pThis)
    28622867{
     
    28652870    pThis->uDownloadHttpStatus = (uint32_t)lHttpStatus;
    28662871
     2872#ifdef CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
    28672873    curl_off_t cbContent = -1;
    28682874    curl_easy_getinfo(pThis->pCurl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &cbContent);
    28692875    if (cbContent >= 0)
    28702876        pThis->cbDownloadContent = (uint64_t)cbContent;
     2877#else
     2878    double rdContent = -1.0;
     2879    curl_easy_getinfo(pThis->pCurl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &rdContent);
     2880    if (rdContent >= 0.0)
     2881        pThis->cbDownloadContent = (uint64_t)rdContent;
     2882#endif
    28712883}
    28722884
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