curl-library
progress_callback
Date: Thu, 22 Nov 2007 11:08:13 -0300
Hi, I have a problem retrieving info when I upload files.
I've found someone else with my problem, but the answer was "i think
that part ok curl is OK"
The problem is:
The signature of the callback
progress_callback(void *clientp,double dltotal,double dlnow,double
ultotal,double ulnow)
When my progress_callback is called and I'm doing upload, ultotal and
ulnow are negative, but with download no problem at all.
This is how I init CURL
curl_easy_setopt(m_curl,CURLOPT_NOSIGNAL,1);
curl_easy_setopt(m_curl,CURLOPT_NOPROGRESS,0);
curl_easy_setopt(m_curl,CURLOPT_PROGRESSDATA,this);
curl_easy_setopt(m_curl,CURLOPT_PROGRESSFUNCTION,pwFTPConnection::progress_callback);
and here I perform the upload
curl_easy_setopt(m_curl, CURLOPT_URL, url.c_str());
FILE * dfile = fopen(m_fileName.str().c_str(),"r");
if(!dfile)
{
m_lastError = curl_easy_strerror(CURLE_FILE_COULDNT_READ_FILE);
m_status = Error;
return;
}
curl_easy_setopt(m_curl, CURLOPT_READDATA, dfile);
curl_easy_setopt(m_curl, CURLOPT_UPLOAD, 1);
m_res = curl_easy_perform(m_curl);
Any idea?
Darío
Received on 2007-11-22