- Timestamp:
- Sep 5, 2018 9:05:45 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/http.h
r74070 r74077 44 44 /** Nil HTTP/HTTPS client handle. */ 45 45 #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 50 46 51 47 … … 413 409 414 410 /** 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 */ 422 typedef DECLCALLBACK(void) FNRTHTTPDOWNLDPROGRCALLBACK(RTHTTP hHttp, void *pvUser, uint64_t cbDownloadTotal, uint64_t cbDownloaded); 423 /** Pointer to a download progress callback. */ 424 typedef FNRTHTTPDOWNLDPROGRCALLBACK *PFNRTHTTPDOWNLDPROGRCALLBACK; 425 426 /** 415 427 * Set a callback function which is called during RTHttpGet*() 416 428 * 417 429 * @returns IPRT status code. 418 430 * @param hHttp The HTTP client handle. 419 * @param pfn DownloadProgressProgress function to be called. Set it to431 * @param pfnCallback Progress function to be called. Set it to 420 432 * NULL to disable the callback. 421 433 * @param pvUser Convenience pointer for the callback function. 422 434 */ 423 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfn DownloadProgress, void *pvUser);435 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfnCallback, void *pvUser); 424 436 425 437 -
trunk/src/VBox/Runtime/generic/http-curl.cpp
r74076 r74077 3355 3355 *********************************************************************************************************************************/ 3356 3356 3357 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfn DownloadProgress, void *pvUser)3357 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PFNRTHTTPDOWNLDPROGRCALLBACK pfnCallback, void *pvUser) 3358 3358 { 3359 3359 PRTHTTPINTERNAL pThis = hHttp; 3360 3360 RTHTTP_VALID_RETURN(pThis); 3361 3361 3362 pThis->pfnDownloadProgress = pfnDownloadProgress;3362 pThis->pfnDownloadProgress = pfnCallback; 3363 3363 pThis->pvDownloadProgressUser = pvUser; 3364 3364 return VINF_SUCCESS; 3365 3365 } 3366 3367 3366 3368 3367
Note:
See TracChangeset
for help on using the changeset viewer.