I am doing some libcurl program in windows xp with VC 2005 (Win 32 program):
program reads a list of urls from input file and try to check http code for each of them.
The program runs pretty slow (10-15 seconds to fetch code per url !) ,and libcurl keep output everything into terminal when I run the program, what's more, it seems the program is NOT just fetching HTTP code in header but the whole page content.
The details code is as below:
Code:
CURL *curl_handle;
//CURLcode res;
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
curl_easy_setopt(curl_handle,CURLOPT_URL,url);
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS);
int curl_code = curl_easy_perform(curl_handle);
http_code = 0;
curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE, &http_code);
curl_easy_cleanup(curl_handle);
curl_global_cleanup();
I been running this code inside BOINC, which disables libcurl terminal output and 10 times faster than this libcurl program alone....
Any idea ?
Thanks,
-Kun