added text to the progress chapter

This commit is contained in:
Daniel Stenberg 2002-03-05 09:01:58 +00:00
parent d6c9a72e15
commit cda16297d1

View File

@ -470,7 +470,30 @@ HTTP POSTing
Showing Progress
[ built-in progress meter, progress callback ]
For historical and traditional reasons, libcurl has a built-in progress meter
that can be switched on and then makes it presents a progress meter in your
terminal.
Switch on the progress meter by, oddly enough, set CURLOPT_NOPROGRESS to
FALSE. This option is set to TRUE by default.
For most applications however, the built-in progress meter is useless and
what instead is interesting is the ability to specify a progress
callback. The function pointer you pass to libcurl will then be called on
irregular intervals with information about the current transfer.
Set the progress callback by using CURLOPT_PROGRESSFUNCTION. And pass a
pointer to a function that matches this prototype:
int progress_callback(void *clientp,
double dltotal,
double dlnow,
double ultotal,
double ulnow);
If any of the input arguments is unknown, a 0 will be passed. The first
argument, the 'clientp' is the pointer you pass to libcurl with
CURLOPT_PROGRESSDATA. libcurl won't touch it.
libcurl with C++