1CURLOPT_DEBUGDATA(3) curl_easy_setopt options CURLOPT_DEBUGDATA(3)
2
3
4
6 CURLOPT_DEBUGDATA - pointer passed to the debug callback
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DEBUGDATA, void *pointer);
12
14 Pass a pointer to whatever you want passed in to your CURLOPT_DEBUGā
15 FUNCTION(3) in the last void * argument. This pointer is not used by
16 libcurl, it is only passed to the callback.
17
19 NULL
20
22 All
23
25 int main(void)
26 {
27 CURL *curl;
28 CURLcode res;
29 struct data my_tracedata;
30
31 curl = curl_easy_init();
32 if(curl) {
33 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
34
35 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &my_tracedata);
36
37 /* the DEBUGFUNCTION has no effect until we enable VERBOSE */
38 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
39
40 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
41 res = curl_easy_perform(curl);
42
43 /* always cleanup */
44 curl_easy_cleanup(curl);
45 }
46 return 0;
47 }
48
50 Always
51
53 Returns CURLE_OK
54
56 CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3),
57
58
59
60libcurl 7.85.0 May 17, 2022 CURLOPT_DEBUGDATA(3)