利用curl下载库对一些文件链接下载时,有一部分链接下载不成功,列如http://i3.17173.itc.cn/2016/news/2016/09/20/sohu0920.jpg,这样的链接,下载后会是只有文件名,没有内容,

如上图。主要下载代码如下:
bool DownloadFile(string URLADDR,string path)
{
CURL *curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, URLADDR.c_str());
struct curl_slist *chunk = NULL;
//char* file;
//FILE* file2=NULL;
FILE* err=NULL;
err=fopen(path.c_str(),"wb");
if(err!=NULL)
{
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, DownloadCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA,err);
curl_easy_setopt(curl, CURLOPT_TIMEOUT,10 );
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 5);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, ProgressCallback);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA,chunk);
}
CURLcode retcCode = curl_easy_perform(curl);
//free(file2);
fclose(err);
curl_easy_cleanup(curl);
return !retcCode;
}
现在琢磨了很久也不知道怎么了,求求大家指点一下。