Сравнить коммиты

...

2 Коммитов

Автор SHA1 Сообщение Дата
Andrew (ShabatovAA) 0f6b48aab3 code: индивидуальный вариант
12 месяцев назад
Andrew (ShabatovAA) 283c812736 code: вариант
12 месяцев назад

@ -61,14 +61,18 @@ Input download(const string& address)
stringstream buffer; stringstream buffer;
CURL* curl = curl_easy_init(); CURL* curl = curl_easy_init();
if(curl) { if(curl) {
CURLcode res; CURLcode res,res1;
curl_easy_setopt(curl, CURLOPT_URL, address.c_str()); curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
if (res != 0){ if (!res){
cout << curl_easy_strerror(res); curl_off_t speed;
exit(1); res1 = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed);
if(!res1){
cout << "Upload speed bytes/sec\n" << speed;
exit(1);
}
} }
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
} }

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