StudentX
StudentX

Reputation: 2323

CURLOPT_PROGRESSFUNCTION what these parameters mean?

In libcurl, what the parameters mean in the function called by setting CURLOPT_PROGRESSFUNCTION?

int function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);

Its a lame question I know but the website doesn't seem to describe, or I wasn't able to find :(

Upvotes: 0

Views: 2249

Answers (1)

wimh
wimh

Reputation: 15222

This example might help. To summarize:

int function(
  void *clientp,  // this is an unchanged pointer as set with CURLOPT_PROGRESSDATA
  double dltotal, // the total bytes to be downloaded (or 0 if not downloading)
  double dlnow,   // the current download bytecount (or 0 if not downloading)
  double ultotal, // the total bytes to be uploaded (or 0 if not uploading)
  double ulnow);  // the current upload bytecount (or 0 if not uploading)

See CURLOPT_PROGRESSDATA for clientp. If you return any value other than 0 from the callback, the transfer will be cancelled.

Upvotes: 2

Related Questions