diff --git a/project/main.cpp b/project/main.cpp index a9c7371..55b77f1 100644 --- a/project/main.cpp +++ b/project/main.cpp @@ -56,6 +56,7 @@ download(const string& address) if(curl) { CURLcode res; + double file_size; curl_easy_setopt(curl, CURLOPT_URL, address.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); @@ -65,6 +66,11 @@ download(const string& address) fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res)); exit(1); } + else + { + res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &file_size); + cerr<<"File size: "<