Asterisk - The Open Source Telephony Project GIT-master-0bf3178
|
Data Structures | |
struct | curl_write_data |
Context structure passed to ast_curl_write_default_cb. More... | |
Functions | |
size_t | curl_write_cb (char *data, size_t size, size_t nmemb, void *clientp) |
A default implementation of a write data callback. More... | |
void | curl_write_data_free (void *obj) |
If you need to do something with the data received other than save it in a memory buffer, you can define a callback that curl will call for each "chunk" of data it receives from the server.
Your callback must follow the specification defined for CURLOPT_WRITEFUNCTION and implement the 'curl_write_callback' prototype.
The following ast_curl_write objects compose a default implementation that will write the data to any FILE * descriptor you choose.
size_t curl_write_cb | ( | char * | data, |
size_t | size, | ||
size_t | nmemb, | ||
void * | clientp | ||
) |
A default implementation of a write data callback.
This is a default implementation of the function described by CURLOPT_WRITEFUNCTION that writes data received to a user-provided FILE *. This function is called by curl itself when it determines it has enough data to warrant a write. This may be influenced by the value of ast_curl_optional_data.per_write_buffer_size. See the CURLOPT_WRITEFUNCTION documentation for more info.
The curl prototype for this function is 'curl_write_callback'
data | Data read by curl. |
size | Always 1. |
nitems | The number of bytes read. |
client_data | A pointer to whatever structure you passed to ast_curler in the curl_write_data parameter. |
Definition at line 150 of file curl_utils.c.
References curl_write_data::_internal_memstream, curl_write_data::bytes_downloaded, CURL_WRITEFUNC_ERROR, curl_write_data::debug_info, errno, LOG_WARNING, curl_write_data::max_download_bytes, curl_write_data::output, S_OR, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, curl_write_data::stream_buffer, and curl_write_data::stream_bytes_downloaded.
Referenced by curler().
void curl_write_data_free | ( | void * | obj | ) |
Definition at line 134 of file curl_utils.c.
References ast_free, ast_std_free(), curl_write_data::debug_info, curl_write_data::output, and curl_write_data::stream_buffer.
Referenced by retrieve_cert_from_url().