From 7449ef860f01c3a5f8a8f0be62287ddaf6ddc3ae Mon Sep 17 00:00:00 2001 From: EfremovSI Date: Sat, 18 May 2024 21:25:15 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D1=81=D0=BA=D0=BE=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D1=81=D0=B5=D1=82=D0=B8,=20=D0=B2=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index c522121..add33d0 100644 --- a/main.cpp +++ b/main.cpp @@ -68,7 +68,7 @@ write_data(void* items, size_t item_size, size_t item_count, void* ctx) { } Input -download(const string& address) { +download(const string& address, bool proverka_skorosti) { stringstream buffer; CURL* curl = curl_easy_init(); if(curl) @@ -79,16 +79,20 @@ download(const string& address) { curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); res = curl_easy_perform(curl); - if (res!=0) - { - res2=curl_easy_strerror(res); - cout< 1) { - in = download(argv[1]); + in = download(argv[1], false); } else { in = input_data(cin, true); } @@ -109,3 +113,4 @@ int main(int argc, char* argv[]) return 0; } +