cURL / Mailing Lists / curl-library / Single Mail


Re: frequency of progress callback

From: Daniel Stenberg <>
Date: Thu, 30 Oct 2003 08:49:22 +0100 (CET)

On Wed, 29 Oct 2003, Wei Weng wrote:

> how do I specify my own frequency of progress callback?

You cannot.

> If I can not, what is the pre-defined frequency?

About once per second.

> Say if I pass a structure

> struct test
> {
> int nTest;
> };

> as the first parameter into a progress callback function (as void* clientp),
> and I happened to change the value of nTest in the progress callback, say I
> do a clientp->nTest++.

> Does it mean my nTest will increase every time progress callback being
> called? Is the void* clientp passed from one progress callback to the next
> one?

The pointer you provide to libcurl will be provided to the callback every time
it is called, yes. If you pass the pointer to a struct of yours, you'll get
the same pointer to the same struct passed to the callback every time it is

> What if the size of the file is a 64 bit integer?
> The progress callback function only has double as dl/up size data type.

libcurl doesn't support file sizes bigger than 2GB. We need to fix this, and I
welcome all help I can get.

And when we fix this, we will need to change the variable types provided to
the progress callback, yes. I would say we will solve that issue by
introducing a new CURLOPT_ option that gets called with the larger variable
type, to remain backwards compatible with older apps.

 Daniel Stenberg -- curl: been grokking URLs since 1998
This email is sponsored by: Giveback Program.
Does help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here:
Received on 2003-10-30