curl-library
CURL debug ?
Date: Mon, 25 Oct 2010 16:03:30 +0700
I want to get the header out, so i try CURLOPT_DEBUGFUNCTION but the break
point never goes to my_curl_debug_callback :(
What wrong with my code ?
This is my code :
#include <curl/curl.h>
#include <windows.h>
int my_curl_debug_callback(CURL *handle, /* the handle/transfer this
concerns */
curl_infotype type, /* what kind of data */
char *data, /* points to the data */
size_t size, /* size of the data pointed to */
void *userptr) /* whatever the user please */
{
if (type == CURLINFO_HEADER_OUT)
{
printf("%s\n", data);
}
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_curl_debug_callback);
curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-25