#define STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES 60000000000
#define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3
struct myprogress
{
double lastruntime;
CURL *curl;
};
size_t write_data(char *buffer, size_t size, size_t nitems, void *outstream)
{
int written = fwrite(buffer, size, nitems, (FILE*)outstream);
return written;
}
static int xferinfo(void *p,
curl_off_t dltotal, curl_off_t dlnow,
curl_off_t ultotal, curl_off_t ulnow, int a)
{
struct myprogress *myp = (struct myprogress *)p;
CURL *curl = myp->curl;
DoEvents();
double dDowning = 0.0, dDwownTotal = 0.0;
curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dDowning);
//int nRandom = rand();
//if (dDowning == 0)
// switch (nRandom % 7)
//{
// case 0:acedSetStatusBarProgressMeter(_T("正"), 0, 100); break;
// case 1:acedSetStatusBarProgres
利用curl下载文件,包括Get和Post
最新推荐文章于 2024-03-18 20:42:41 发布