I need to know the status of my download using libcurl in C. I found that I have to use CURLOPT_PROGRESSFUNCTION.
int progress_func(void* ptr, double TotalToDownload, double NowDownloaded,
double TotalToUpload, double NowUploaded)
{
//Bla bla
}
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func);
I can't understand two things: 1) This function progress_func "how often" is called? 2) How can I pass other parameters to progress_func function? Because I have to write the connection status (speed, tot downloaded) in a file with a variable url, so I have to pass this url to the function.
Thanks