Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

curlopt_chunk_bgn_function(3) [mojave man page]

CURLOPT_CHUNK_BGN_FUNCTION(3)				     curl_easy_setopt options				     CURLOPT_CHUNK_BGN_FUNCTION(3)

NAME
CURLOPT_CHUNK_BGN_FUNCTION - callback before a transfer with FTP wildcardmatch SYNOPSIS
#include <curl/curl.h> long chunk_bgn_callback(const void *transfer_info, void *ptr, int remains); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CHUNK_BGN_FUNCTION, chunk_bgn_callback); DESCRIPTION
Pass a pointer to your callback function, which should match the prototype shown above. This callback function gets called by libcurl before a part of the stream is going to be transferred (if the transfer supports chunks). The transfer_info pointer will point to a struct curl_fileinfo with details about the file that is about to get transferred. This callback makes sense only when using the CURLOPT_WILDCARDMATCH(3) option for now. The target of transfer_info parameter is a "feature depended" structure. For the FTP wildcard download, the target is curl_fileinfo struc- ture (see curl/curl.h). The parameter ptr is a pointer given by CURLOPT_CHUNK_DATA(3). The parameter remains contains number of chunks remaining per the transfer. If the feature is not available, the parameter has zero value. Return CURL_CHUNK_BGN_FUNC_OK if everything is fine, CURL_CHUNK_BGN_FUNC_SKIP if you want to skip the concrete chunk or CURL_CHUNK_BGN_FUNC_FAIL to tell libcurl to stop if some error occurred. DEFAULT
NULL PROTOCOLS
FTP EXAMPLE
TODO AVAILABILITY
This was added in 7.21.0 RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_CHUNK_END_FUNCTION(3), CURLOPT_WILDCARDMATCH(3), libcurl 7.54.0 February 03, 2016 CURLOPT_CHUNK_BGN_FUNCTION(3)

Check Out this Related Man Page

CURLOPT_XFERINFOFUNCTION(3)				     curl_easy_setopt options				       CURLOPT_XFERINFOFUNCTION(3)

NAME
CURLOPT_XFERINFOFUNCTION - callback to progress meter function SYNOPSIS
#include <curl/curl.h> int progress_callback(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_XFERINFOFUNCTION, progress_callback); DESCRIPTION
Pass a pointer to your callback function, which should match the prototype shown above. This function gets called by libcurl instead of its internal equivalent with a frequent interval. While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second. clientp is the pointer set with CURLOPT_XFERINFODATA(3), it is not used by libcurl but is only passed along from the application to the callback. The callback gets told how much data libcurl will transfer and has transferred, in number of bytes. dltotal is the total number of bytes libcurl expects to download in this transfer. dlnow is the number of bytes downloaded so far. ultotal is the total number of bytes libcurl expects to upload in this transfer. ulnow is the number of bytes uploaded so far. Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that. Returning a non-zero value from this callback will cause libcurl to abort the transfer and return CURLE_ABORTED_BY_CALLBACK. If you transfer data with the multi interface, this function will not be called during periods of idleness unless you call the appropriate libcurl function that performs transfers. CURLOPT_NOPROGRESS(3) must be set to 0 to make this function actually get called. DEFAULT
By default, libcurl has an internal progress meter. That's rarely wanted by users. PROTOCOLS
All EXAMPLE
https://curl.haxx.se/libcurl/c/progressfunc.html AVAILABILITY
Added in 7.32.0. This callback replaces CURLOPT_PROGRESSFUNCTION(3) RETURN VALUE
Returns CURLE_OK. SEE ALSO
CURLOPT_XFERINFODATA(3), CURLOPT_NOPROGRESS(3), libcurl 7.54.0 February 03, 2016 CURLOPT_XFERINFOFUNCTION(3)
Man Page