cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Difference between Read/Write Callback and Progress Callback

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 24 Nov 2003 09:53:57 +0100 (CET)

On Mon, 24 Nov 2003, Pravin Jade wrote:

> I want to know how Progress Callback is different from Read /Write
> callbacks. When Read/Write and Progress callbacks are called by libcurl ?

The read and write callbacks are called when libcurl wants to read or write
data from/to the local tile system (or similar). Thus, these are only called
if there's data actually being transfered.

The progress callback is called every now and then even if there's no data
being transfered.

> Can anyone show me example for how to use Progress Callback ?

Try the curl command line tool source code, it uses it for the --progress-bar
feature.

> My requirement is to show a progress-bar to user while uploading a big file
> of say 70-80 MB size.

That's what the progress callback is for!

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
 [[ Do not post private mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
Received on 2003-11-24