1CURLOPT_RESOLVER_START_DATA(c3u)rl_easy_setopt optioCnUsRLOPT_RESOLVER_START_DATA(3)
2
3
4
6 CURLOPT_RESOLVER_START_DATA - custom pointer passed to the resolver
7 start callback
8
10 #include <curl/curl.h>
11
12 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESOLVER_START_DATA,
13 void *pointer);
14
16 Pass a pointer that will be untouched by libcurl and passed as the
17 third argument in the resolver start callback set with CURLOPT_RE‐
18 SOLVER_START_FUNCTION(3).
19
21 NULL
22
24 All
25
27 static int resolver_start_cb(void *resolver_state, void *reserved,
28 void *userdata)
29 {
30 (void)reserved;
31 printf("Received resolver_state=%p userdata=%p\n",
32 resolver_state, userdata);
33 return 0;
34 }
35
36 CURL *curl = curl_easy_init();
37 if(curl) {
38 curl_easy_setopt(curl, CURLOPT_RESOLVER_START_FUNCTION, resolver_start_cb);
39 curl_easy_setopt(curl, CURLOPT_RESOLVER_START_DATA, curl);
40 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
41 curl_easy_perform(curl);
42 curl_easy_cleanup(curl);
43 }
44
46 Added in 7.59.0
47
49 Returns CURLE_OK
50
52 CURLOPT_RESOLVER_START_FUNCTION(3)
53
54
55
56libcurl 7.79.1 November 04, 2020CURLOPT_RESOLVER_START_DATA(3)