中libcurl
,设置调用的函数中的参数是什么意思CURLOPT_PROGRESSFUNCTION
?
int function(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
我知道这是一个蹩脚的问题,但网站似乎没有描述,或者我找不到:(
这个例子可能会有所帮助。总结一下:
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)
请参阅CURLOPT_PROGRESSDATA了解clientp
. 如果您从回调中返回 0 以外的任何值,则传输将被取消。