E
Es lüppt.
void loadData1(const char *url, const char *filename)
{
CURL *curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_URL, url);
/* enable all supported built-in compressions */
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
FILE *fp = fopen(filename, "wb");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
time_t t1 = time(0);
/* Perform the request, res will get the return code */
CURLcode res = curl_easy_perform(curl);
time_t t2 = time(0);
cout << (t2 - t1) << " Sek " << ((t2 - t1) / 60.0) << " Min" << endl;
/* Check for errors */
if (res != CURLE_OK)
{
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
}
/* always cleanup */
curl_easy_cleanup(curl);
fclose(fp);
}
}
Für 200 MB braucht er zum Bleistift 10 Sekunden und da das 4-mal schneller als meine Anschluss ist, gehe ich davon aus dass alles stark komprimiert gesendet/empfangen wird...