2012-12-01 216 views
0

libcurl中,通过设置CURLOPT_PROGRESSFUNCTION调用的函数中的参数意味着什么? 。CURLOPT_PROGRESSFUNCTION这些参数是什么意思?

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

它是一种跛脚的问题,我知道,但该网站似乎并没有描述,或者我是不是能找到:(

回答

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) 

请参阅CURLOPT_PROGRESSDATA对于clientp。 如果您从回调中返回0以外的任何值,传输将被取消。