Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Data Structures | |
struct | curl_open_socket_data |
Context structure passed to ast_curl_open_socket_default_cb. More... | |
Functions | |
curl_socket_t | curl_open_socket_cb (void *client_data, curlsocktype purpose, struct curl_sockaddr *address) |
A default implementation of an open socket callback. More... | |
void | curl_open_socket_data_free (void *obj) |
If you need to allocate the socket curl uses to make the request yourself or you need to do some checking on the request's resolved IP address, this is the callback for you.
Your callback must follow the specification defined for CURLOPT_OPENSOCKETFUNCTION and implement the 'curl_opensocket_callback' prototype.
The following ast_open_socket objects compose a default implementation that will not allow requests to servers not whitelisted in the provided ast_acl_list.
curl_socket_t curl_open_socket_cb | ( | void * | client_data, |
curlsocktype | purpose, | ||
struct curl_sockaddr * | address | ||
) |
A default implementation of an open socket callback.
This is an implementation of the function described by CURLOPT_OPENSOCKETFUNCTION that checks the request's IP address against a user-supplied ast_acl_list and either rejects the request if the IP address isn't allowed, or opens a socket and returns it to curl. See the CURLOPT_OPENSOCKETFUNCTION documentation for more info.
client_data | A pointer to whatever structure you passed to ast_curler in the curl_write_data parameter. |
purpose | Will always be CURLSOCKTYPE_IPCXN |
address | The request server's resolved IP address |
Definition at line 205 of file curl_utils.c.
References curl_open_socket_data::acl, ast_acl_list_is_empty(), ast_apply_acl(), AST_SENSE_ALLOW, ast_sockaddr_copy_sockaddr(), curl_open_socket_data::debug_info, errno, LOG_WARNING, NULL, S_OR, SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, and curl_open_socket_data::sockfd.
Referenced by curler().
void curl_open_socket_data_free | ( | void * | obj | ) |
Definition at line 193 of file curl_utils.c.
References ast_free, and curl_open_socket_data::debug_info.
Referenced by retrieve_cert_from_url().