code: добавил вариант

master
ShchipkovMY 2 лет назад
Родитель 6b9bcb3caa
Сommit 52ee0dacc3

@ -54,6 +54,7 @@ download(const string& address)
if(curl)
{
CURLcode res;
double file_size;
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
@ -63,6 +64,11 @@ download(const string& address)
fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res));
exit(1);
}
else
{
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &file_size);
cerr<<"File size: "<<file_size<<" bytes";
}
curl_easy_cleanup(curl);
}

Загрузка…
Отмена
Сохранить