1CURLOPT_CHUNK_END_FUNCTION(3c)url_easy_setopt optionCsURLOPT_CHUNK_END_FUNCTION(3)
2
3
4

NAME

6       CURLOPT_CHUNK_END_FUNCTION  -  callback after a transfer with FTP wild‐
7       cardmatch
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       long chunk_end_callback(void *ptr);
13
14       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CHUNK_END_FUNCTION,
15                                 chunk_end_callback);
16

DESCRIPTION

18       Pass a pointer to your callback function, which should match the proto‐
19       type shown above.
20
21       This  function  gets  called by libcurl as soon as a part of the stream
22       has been transferred (or skipped).
23
24       Return   CURL_CHUNK_END_FUNC_OK    if    everything    is    fine    or
25       CURL_CHUNK_END_FUNC_FAIL  to  tell  the  lib  to  stop  if  some  error
26       occurred.
27

DEFAULT

29       NULL
30

PROTOCOLS

32       FTP
33

EXAMPLE

35       static long file_is_downloaded(struct callback_data *data)
36       {
37         if(data->output) {
38           fclose(data->output);
39           data->output = 0x0;
40         }
41         return CURL_CHUNK_END_FUNC_OK;
42       }
43
44       int main()
45       {
46         /* data for callback */
47         struct callback_data callback_info;
48         curl_easy_setopt(curl, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded);
49         curl_easy_setopt(curl, CURLOPT_CHUNK_DATA, &callback_info);
50       }
51

AVAILABILITY

53       Added in 7.21.0
54

RETURN VALUE

56       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
57       if not.
58

SEE ALSO

60       CURLOPT_WILDCARDMATCH(3), CURLOPT_CHUNK_BGN_FUNCTION(3),
61
62
63
64libcurl 7.61.1                   May 31, 2017    CURLOPT_CHUNK_END_FUNCTION(3)
Impressum