diff --git a/main.cpp b/main.cpp index 7e0ec4e..e70e764 100644 --- a/main.cpp +++ b/main.cpp @@ -54,6 +54,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); @@ -63,6 +64,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: "<