BiriukovaAlS 2 лет назад
Родитель 877e45e7f0
Сommit d35ba2cda1

@ -11,9 +11,15 @@
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-g" />
<Add directory="curl/include" />
</Compiler>
<Linker>
<Add library="libcurl.dll.a" />
<Add directory="curl/lib" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin/Release/lab3344" prefix_auto="1" extension_auto="1" />
@ -31,8 +37,21 @@
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
<Add directory="curl/include" />
</Compiler>
<Linker>
<Add library="libcurl.dll.a" />
<Add directory="curl/lib" />
</Linker>
<Unit filename=".gitignore" />
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="histogram_internal.h" />
<Unit filename="main.cpp" />
<Unit filename="svg.cpp" />
<Unit filename="svg.h" />
<Unit filename="text.cpp" />
<Unit filename="text.h" />
<Extensions>
<lib_finder disable_auto="1" />
</Extensions>

@ -60,16 +60,26 @@ download(const string& address)
if(curl)
{
CURLcode res;
double total;
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
res = curl_easy_perform(curl);
if (res != 0)
if (res != CURLE_OK)
{
cout << curl_easy_strerror(res);
exit(1);
}
if(CURLE_OK == res)
{
res = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total);
if(CURLE_OK == res)
{
cerr<<"Time: "<< total;
}
}
curl_easy_cleanup(curl);
}
return input_data(buffer, false);

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