Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Data Structures | |
struct | curl_header_data |
Context structure passed to ast_curl_header_default_cb. More... | |
Functions | |
size_t | curl_header_cb (char *data, size_t size, size_t nitems, void *client_data) |
A default implementation of a header callback. More... | |
void | curl_header_data_free (void *obj) |
If you need to access the headers returned on the response, you can define a callback that curl will call for every header it receives.
Your callback must follow the specification defined for CURLOPT_HEADERFUNCTION and implement the curl_write_callback prototype.
The following ast_curl_headers objects compose a default implementation that will accumulate the headers in an ast_variable list.
size_t curl_header_cb | ( | char * | data, |
size_t | size, | ||
size_t | nitems, | ||
void * | client_data | ||
) |
A default implementation of a header callback.
This is an implementation of #CURLOPT_HEADERFUNCTION that performs basic sanity checks and saves headers in the ast_curl_header_data.headers ast_variable list.
The curl prototype for this function is curl_write_callback
data | Will contain a header line that may not be NULL terminated. |
size | Always 1. |
nitems | The number of bytes in data. |
client_data | A pointer to whatever structure you passed to ast_curler in the curl_header_data parameter. |
Definition at line 39 of file curl_utils.c.
References curl_header_data::_capture, ast_alloca, ast_begins_with(), ast_copy_string(), AST_CURL_DEFAULT_MAX_HEADER_LEN, ast_skip_blanks(), ast_trim_blanks(), ast_variable_list_append, ast_variable_new, CURL_WRITEFUNC_ERROR, curl_header_data::debug_info, curl_header_data::headers, LOG_WARNING, curl_header_data::max_header_len, NULL, S_OR, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, and value.
Referenced by curler().
void curl_header_data_free | ( | void * | obj | ) |
Definition at line 26 of file curl_utils.c.
References ast_free, ast_variables_destroy(), curl_header_data::debug_info, and curl_header_data::headers.
Referenced by retrieve_cert_from_url().