libcurl库 processfunc不停

作为一个伟大的客户端女程序 我要抱怨下!!为什么让我看libcurl嘛 做cegui就已经偏离图形很远了 现在都偏到服务器上了!!!

 curl_easy_setopt(m_curlhandle, CURLOPT_PROGRESSFUNCTION, progressfunc);

症状:下载很大的文件时 回执函数processfunc会一直被调用,即使

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

dltotal和dlnow 已经相等

 

解决:不想去想为什么 都下载满了 processfunc还在被调用 有人说 网站post了空包 再post个buffer就行了 我也不知道怎么post

我的解决方法是  curl_easy_setopt(_this->m_curlhandle, CURLOPT_NOPROGRESS, true);

用这个在processfunc里检测到下载完毕的时候 调用此属性设置 终止之后对processfunc的调用 并进行后续处理

 

 

posted on 2011-11-07 10:00  minggoddess  阅读(290)  评论(0编辑  收藏  举报