diff --git a/project/main.cpp b/project/main.cpp index bc0d574..d829801 100644 --- a/project/main.cpp +++ b/project/main.cpp @@ -49,15 +49,23 @@ download(const string& address) if(curl) { CURLcode res; + curl_off_t speed; 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 != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res)); exit(1); } + res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed); + if(!res) + { + cerr<<"Download speed bytes/sec: " <