1CURLOPT_PREREQDATA(3)      curl_easy_setopt options      CURLOPT_PREREQDATA(3)
2
3
4

NAME

6       CURLOPT_PREREQDATA - pointer passed to the pre-request callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PREREQDATA, void *pointer);
12

DESCRIPTION

14       Pass  a  pointer  that  will  be untouched by libcurl and passed as the
15       first argument in the pre-request callback set with CURLOPT_PREREQFUNC‐
16       TION(3).
17

DEFAULT

19       NULL
20

PROTOCOLS

22       All
23

EXAMPLE

25       static int prereq_callback(void *clientp,
26                                  char *conn_primary_ip,
27                                  char *conn_local_ip,
28                                  int conn_primary_port,
29                                  int conn_local_port)
30       {
31         printf("Connection made to %s:%s\n", conn_primary_ip, conn_primary_port);
32         return CURL_PREREQFUNC_OK;
33       }
34
35       {
36         struct data prereq_data;
37         curl_easy_setopt(CURL *handle, CURLOPT_PREREQFUNCTION, prereq_callback);
38         curl_easy_setopt(CURL *handle, CURLOPT_PREREQDATA, &prereq_data);
39       }
40

AVAILABILITY

42       Added in 7.80.0
43

RETURN VALUE

45       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
46       if not.
47

SEE ALSO

49       CURLOPT_PREREQFUNCTION(3)
50
51
52
53libcurl 8.0.1                  January 02, 2023          CURLOPT_PREREQDATA(3)
Impressum