VirtualBox

Changeset 74077 in vbox for trunk


Ignore:
Timestamp:
Sep 5, 2018 9:05:45 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/http: document download progress callback. bugref:9167

Location:
trunk
Files:
2 edited

Legend:

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

    r74070 r74077  
    4444/** Nil HTTP/HTTPS client handle. */
    4545#define NIL_RTHTTP                              ((RTHTTP)0)
    46 /** Callback function to be called during RTHttpGet*(). Register it using RTHttpSetDownloadProgressCallback(). */
    47 typedef DECLCALLBACK(void) FNRTHTTPDOWNLDPROGRCALLBACK(RTHTTP hHttp, void *pvUser, uint64_t cbDownloadTotal, uint64_t cbDownloaded);
    48 typedef FNRTHTTPDOWNLDPROGRCALLBACK *PFNRTHTTPDOWNLDPROGRCALLBACK;
    49 
    5046
    5147
     
    413409
    414410/**
     411 * Callback function to be called during RTHttpGet*().
     412 *
     413 * Register it using RTHttpSetDownloadProgressCallback().
     414 *
     415 * @param   hHttp           The HTTP client handle.
     416 * @param   pvUser          The user parameter specified when registering the callback.
     417 * @param   cbDowloadTotal  The content-length value, if available.
     418 *                          Warning! Not entirely clear what it will be if
     419 *                                   unavailable, probably 0.
     420 * @param   cbDowloaded     How much was downloaded thus far.
     421 */
     422typedef DECLCALLBACK(void) FNRTHTTPDOWNLDPROGRCALLBACK(RTHTTP hHttp, void *pvUser, uint64_t cbDownloadTotal, uint64_t cbDownloaded);
     423/** Pointer to a download progress callback. */
     424typedef FNRTHTTPDOWNLDPROGRCALLBACK *PFNRTHTTPDOWNLDPROGRCALLBACK;
     425
     426/**
    415427 * Set a callback function which is called during RTHttpGet*()
    416428 *
    417429 * @returns IPRT status code.
    418430 * @param   hHttp           The HTTP client handle.
    419  * @param   pfnDownloadProgress Progress function to be called. Set it to
     431 * @param   pfnCallback    Progress function to be called. Set it to
    420432 *                          NULL to disable the callback.
    421433 * @param   pvUser          Convenience pointer for the callback function.
    422434 */
    423 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfnDownloadProgress, void *pvUser);
     435RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfnCallback, void *pvUser);
    424436
    425437
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r74076 r74077  
    33553355*********************************************************************************************************************************/
    33563356
    3357 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfnDownloadProgress, void *pvUser)
     3357RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfnCallback, void *pvUser)
    33583358{
    33593359    PRTHTTPINTERNAL pThis = hHttp;
    33603360    RTHTTP_VALID_RETURN(pThis);
    33613361
    3362     pThis->pfnDownloadProgress = pfnDownloadProgress;
     3362    pThis->pfnDownloadProgress    = pfnCallback;
    33633363    pThis->pvDownloadProgressUser = pvUser;
    33643364    return VINF_SUCCESS;
    33653365}
    3366 
    33673366
    33683367
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