Here is the remaining code: double totalDownloadableSize = 0 // total size of the download, set prior to starting download of the first fileĭouble downloadedSizeTillNow = 0 // total size downloaded till now - keep adding file size that just completed downloadingĭouble currentDownloadingSize = 0 // size that we are downloading - downloadedSizeTillNow + bytes downloaded of the current file (in TraceProgress Function)ĭouble oldDownloadNow = 0 // size of the old download bytes of that particular file This is how I setup curl to call TraceProgress function during download: curl_easy_setopt( curl, CURLOPT_PROGRESSFUNCTION, TraceProgress ) Ĭurl_easy_setopt( curl, CURLOPT_PROGRESSDATA, &response ) Ĭurl_easy_setopt( curl, CURLOPT_NOPROGRESS, 0 ) In my Download Function the program recursively download each file till all the files are being downloaded. The download speed sometimes go too high and sometimes its 0. And I am not able to do it correctly, and now going through it for many hours, its getting too confusing. I am trying to figure out how to calculate current download speed while downloading Folder of many file(Its not a single file that I am downloading).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |