|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker Archives
[curl:bugs] #1238 progressfunction called too much
From: Nach M. S. <n-a-c-h_at_users.sf.net>
Date: Tue, 11 Jun 2013 09:21:40 +0000
I think I have the answer to your why.
>From multi.c:
if(( (data->set.max_send_speed == 0) ||
I believe you're calling Curl_pgrsUpdate() here in order to update progress.ulspeed and progress.dlspeed, additionally, you're calling Curl_pgrsUpdate() other places in the code as well, unrelated to speed limiting.
To solve, the parts within Curl_pgrsUpdate() which update progress.ulspeed and progress.dlspeed should probably be factored into a new function. Then this segment in multi.c can call the new function, while other places can continue to call Curl_pgrsUpdate() which in turn calls the new function.
Additionally, I noticed that speed limiting on transfering large files isn't precisely accurate. Meaning I've maxed an upload to 8MB/s, yet external reporting tools are telling me the upload is approaching 9MB/s. This probably means that a moving average somehow isn't being precisely accounted for...
--- ** [bugs:#1238] progressfunction called too much** **Status:** open **Labels:** progresscallback rate-limiting **Created:** Mon Jun 03, 2013 08:55 PM UTC by Daniel Stenberg **Last Updated:** Tue Jun 11, 2013 06:21 AM UTC **Owner:** nobody (bug reported by Miguel Angel in http://curl.haxx.se/mail/lib-2013-05/0254.html) I am using pycurl in a small script to download coursera videos, it's working fine but the callback i installed to display a progress bar in console it's called 22188558 times in 70 seconds of execution, it hangs 1 core of the machine all the time. given the documentation states should be called "roughly once per second or sooner" this seems too much for me, i am using this code to use it, it's python but i think it's pretty readable. ::: python curl = pycurl.Curl() curl.setopt(curl.URL, url) if rate_limit is not None: curl.setopt(curl.MAX_RECV_SPEED_LARGE, rate_limit) file_store = open(filename, "wb") curl.setopt(curl.WRITEDATA, file_store) curl.setopt(curl.NOPROGRESS, 0) curl.setopt(curl.PROGRESSFUNCTION, curl_progress) curl.setopt(curl.FOLLOWLOCATION, 1) #cookies curl.setopt(curl.COOKIEJAR, cookies_filename) curl.setopt(curl.COOKIEFILE, cookies_filename) try: curl.perform() except: import traceback my_logger.error(u"Error downloading file: %s" % traceback.format_exc()) #cleaning curl.close() file_store.close() no matter that i define curl_progress as: def curl_progress(dl_total, dl_now, ul_total, ul_now): return 0 it's called so much times that hangs 1 cpu core anyway. --- Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1238/> To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>Received on 2013-06-11 These mail archives are generated by hypermail. |
Page updated May 06, 2013.
web site info