2012-12-01 212 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以外的任何值,傳輸將被取消。