work with CURL
Этот коммит содержится в:
@@ -40,7 +40,6 @@ Input download(const string& address) {
|
|||||||
if (curl) {
|
if (curl) {
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
|
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
|
||||||
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);
|
||||||
@@ -51,7 +50,8 @@ Input download(const string& address) {
|
|||||||
auto data = curl_version_info(CURLVERSION_NOW)->protocols;
|
auto data = curl_version_info(CURLVERSION_NOW)->protocols;
|
||||||
for (auto protocol = data; *protocol; ++protocol) {
|
for (auto protocol = data; *protocol; ++protocol) {
|
||||||
cerr << *protocol << endl;
|
cerr << *protocol << endl;
|
||||||
} curl_easy_cleanup(curl);
|
}
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
}
|
}
|
||||||
return input_data(buffer);
|
return input_data(buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user