26 RCSIDH(curl_h,
"$Id: 2bbce6775e3d55b80e7ac288af50420d6e323d0c $")
32 #define CURL_NO_OLDIES 1
34 #include <curl/curl.h>
35 #include <freeradius-devel/server/global_lib.h>
36 #include <freeradius-devel/server/module.h>
37 #include <freeradius-devel/server/request.h>
38 #include <freeradius-devel/util/event.h>
39 #include <freeradius-devel/util/slab.h>
40 #include <freeradius-devel/unlang/xlat.h>
45 #define FR_CURL_SET_OPTION(_x, _y)\
48 if ((_ret = curl_easy_setopt(randle->candle, _x, _y)) != CURLE_OK) {\
50 _option = STRINGIFY(_x);\
51 ERROR("Failed setting curl option %s: %s (%i)", _option, curl_easy_strerror(_ret), _ret);\
56 #define FR_CURL_ROPTIONAL_SET_OPTION(_x, _y)\
59 if ((_ret = curl_easy_setopt(randle->candle, _x, _y)) != CURLE_OK) {\
61 _option = STRINGIFY(_x);\
62 ROPTIONAL(RERROR, ERROR, "Failed setting curl option %s: %s (%i)", _option, curl_easy_strerror(_ret), _ret);\
67 #define FR_CURL_REQUEST_SET_OPTION(_x, _y)\
70 if ((_ret = curl_easy_setopt(randle->candle, _x, _y)) != CURLE_OK) {\
72 _option = STRINGIFY(_x);\
73 RERROR("Failed setting curl option %s: %s (%i)", _option, curl_easy_strerror(_ret), _ret);\
81 #ifndef CURL_AT_LEAST_VERSION
82 # define CURL_VERSION_BITS(x, y, z) ((x) << 16 | (y) << 8 | (z))
83 # define CURL_AT_LEAST_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
#define DIAG_UNKNOWN_PRAGMAS
Defines a CONF_PAIR to C data type mapping.
char const * private_key_password
fr_event_list_t * el
Event list servicing I/O events.
char const * private_key_file
char const * certificate_file
int fr_curl_response_certinfo(request_t *request, fr_curl_io_request_t *randle)
char const * keylog_file
Where to log SSL keying material like the pre-master secret.
fr_curl_handle_t * fr_curl_io_init(TALLOC_CTX *ctx, fr_event_list_t *el, bool multiplex)
CURLcode result
Result of executing the request.
int fr_curl_easy_tls_init(fr_curl_io_request_t *randle, fr_curl_tls_t const *conf)
char const * ca_issuer_file
uint64_t transfers
How many transfers are current in progress.
global_lib_autoinst_t fr_curl_autoinst
CURLM * mandle
The multi handle.
request_t * request
Current request.
fr_event_timer_t const * ev
Multi-Handle timer.
conf_parser_t fr_curl_conn_config[]
fr_curl_io_request_t * fr_curl_io_request_alloc(TALLOC_CTX *ctx)
Allocate a new curl easy request and wrapper struct.
fr_time_delta_t connect_timeout
CURL * fr_curl_tmp_handle(void)
Return a thread local curl easy handle.
void * uctx
Private data for the module using the API.
conf_parser_t fr_curl_tls_config[]
int fr_curl_io_request_enqueue(fr_curl_handle_t *mhandle, request_t *request, fr_curl_io_request_t *creq)
Sends a request using libcurl.
CURL * candle
Request specific handle.
Uctx data for timer and I/O functions.
Structure representing an individual request being passed to curl for processing.
Structure to define how to initialise libraries with global configuration.
Stores all information relating to an event list.
Tuneable parameters for slabs.
A time delta, a difference in time measured in nanoseconds.
static fr_event_list_t * el