Changeset 58217 in vbox
- Timestamp:
- Oct 13, 2015 3:36:47 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/iprt/http.h (modified) (2 diffs)
-
src/VBox/Runtime/generic/http-curl.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/http.h
r58199 r58217 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) RTHTTPDOWNLDPROGRCALLBACK(RTHTTP hHttp, void *pvUser, uint64_t cbDownloadTotal, uint64_t cbDownloaded); 48 typedef RTHTTPDOWNLDPROGRCALLBACK *PRTHTTPDOWNLDPROGRCALLBACK; 49 46 50 47 51 … … 283 287 RTR3DECL(int) RTHttpGatherCaCertsInFile(const char *pszCaFile, uint32_t fFlags, PRTERRINFO pErrInfo); 284 288 289 /** 290 * Set a callback function which is called during RTHttpGet*() 291 * 292 * @returns IPRT status code. 293 * @param hHttp The HTTP client instance. 294 * @param pfnDownloadProgress Progress function to be called. Set it to 295 * NULL to disable the callback. 296 */ 297 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PRTHTTPDOWNLDPROGRCALLBACK pfnDownloadProgress); 298 299 285 300 /** @} */ 286 301 -
trunk/src/VBox/Runtime/generic/http-curl.cpp
r58206 r58217 150 150 /** Download size hint set by the progress callback. */ 151 151 uint64_t cbDownloadHint; 152 /** Callback called during download. */ 153 PRTHTTPDOWNLDPROGRCALLBACK pfnDownloadProgress; 154 /** User pointer parameter for pfnDownloadProgress. */ 155 void *pvDownloadProgressUser; 152 156 } RTHTTPINTERNAL; 153 157 /** Pointer to an internal HTTP client instance. */ … … 2121 2125 pThis->cbDownloadHint = (uint64_t)rdTotalDownload; 2122 2126 2127 if (pThis->pfnDownloadProgress) 2128 pThis->pfnDownloadProgress(pThis, pThis->pvDownloadProgressUser, (uint64_t)rdTotalDownload, (uint64_t)rdDownloaded); 2129 2123 2130 return pThis->fAbort ? 1 : 0; 2124 2131 } … … 2505 2512 } 2506 2513 2514 2515 RTR3DECL(int) RTHttpSetDownloadProgressCallback(RTHTTP hHttp, PRTHTTPDOWNLDPROGRCALLBACK pfnDownloadProgress, void *pvUser) 2516 { 2517 PRTHTTPINTERNAL pThis = hHttp; 2518 RTHTTP_VALID_RETURN(pThis); 2519 2520 pThis->pfnDownloadProgress = pfnDownloadProgress; 2521 pThis->pvDownloadProgressUser = pvUser; 2522 return VINF_SUCCESS; 2523 }
Note:
See TracChangeset
for help on using the changeset viewer.

