cURL / Mailing Lists / curl-library / Single Mail

curl-library

PROGRESSFUNCTION does not work as described

From: NSRT Mail account. <joecool22us_at_yahoo.com>
Date: Thu, 13 Jun 2013 13:55:25 -0700 (PDT)

The documentation says the following regrarding a progress function:

CURLOPT_PROGRESSFUNCTION
Pass a pointer to a function that matches the following prototype: int function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); . This function gets called by libcurl instead of its internal equivalent with a frequent interval during operation (roughly once per second or
sooner) no matter if data is being transferred or not.
clientp is the pointer set with CURLOPT_PROGRESSDATA, it is not actually used by libcurl but is only passed along from the application to the callback.

Perhaps the meaning is ambiguous, but the documentation suggests that the callback is generally called once per second, and sometimes a little bit more. Meaning the expectation is that if an operation takes 100 seconds, the callback will be called 100 times, or 100 times plus a small percentage.

However, in testing, I'm seeing the callback being called hudreds of times per second. Yes, this is sooner, but it is several times the magnitude one expects based on the wording in the documentation.

> This is in fact by design. We can
discuss changing that in some ways, but that's how libcurl has been
working for a long time.

If this is indeed intended, then the documentation should be updated accordingly, in order to remove any ambiguity in meaning.

-Nach

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-13