CURLOPT_PROGRESSFUNCTION这些参数是什么意思?

时间:2012-12-01 08:05:24

标签: c++ libcurl

libcurl中,通过设置CURLOPT_PROGRESSFUNCTION调用的函数中参数的含义是什么?

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

这是我知道的一个蹩脚的问题,但网站似乎没有描述,或者我无法找到:(

1 个答案:

答案 0 :(得分:2)

example可能有所帮助。总结一下:

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)

clientp查看{{1}}。 如果从回调中返回0以外的任何值,则传输将被取消。

相关问题