|
|
|
@ -56,7 +56,12 @@ download(const string& address) {
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
|
|
|
|
|
res = curl_easy_perform(curl);
|
|
|
|
|
if (res!=CURLE_OK){
|
|
|
|
|
cerr << curl_easy_strerror(res);
|
|
|
|
|
char *ip;
|
|
|
|
|
if (!curl_easy_getinfo(curl, CURLINFO_PRIMARY_IP, &ip)) {
|
|
|
|
|
cerr << "Error downloading file from " << ip << ": " << curl_easy_strerror(res) << endl;
|
|
|
|
|
} else {
|
|
|
|
|
cerr << "Error downloading file: " << curl_easy_strerror(res) << endl;
|
|
|
|
|
}
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
|