Грудинин Егор 11 месяцев назад
Родитель 5b08c3292a
Сommit 2bb1086a1c

@ -13,7 +13,12 @@
<Option compiler="gcc" /> <Option compiler="gcc" />
<Compiler> <Compiler>
<Add option="-g" /> <Add option="-g" />
<Add directory="curl/include" />
</Compiler> </Compiler>
<Linker>
<Add library="curl/lib/libcurl.dll.a" />
<Add directory="curl/bin" />
</Linker>
</Target> </Target>
<Target title="Release"> <Target title="Release">
<Option output="bin/Release/lab01" prefix_auto="1" extension_auto="1" /> <Option output="bin/Release/lab01" prefix_auto="1" extension_auto="1" />

@ -56,7 +56,12 @@ download(const string& address) {
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!=CURLE_OK){ 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); exit(1);
} }
curl_easy_cleanup(curl); curl_easy_cleanup(curl);

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