Curl global initialisation.
More...
#include <freeradius-devel/curl/base.h>
#include <freeradius-devel/curl/xlat.h>
#include <freeradius-devel/util/talloc.h>
#include <freeradius-devel/util/syserror.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include "attrs.h"
Go to the source code of this file.
Curl global initialisation.
- Id
- a700bb2c0ceb17ae09040d3f3656b1eb0c479862
- Copyright
- 2020 Arran Cudbard-Bell (a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg)
Definition in file base.c.
◆ _curl_tmpl_handle()
static int _curl_tmpl_handle |
( |
void * |
arg | ) |
|
|
static |
Free the curl easy handle.
- Parameters
-
[in] | arg | curl easy handle to free. |
Definition at line 264 of file base.c.
◆ fr_curl_easy_tls_init()
◆ fr_curl_free()
static void fr_curl_free |
( |
void |
| ) |
|
|
static |
◆ fr_curl_init()
static int fr_curl_init |
( |
void |
| ) |
|
|
static |
Initialise global curl options.
libcurl is meant to performa reference counting, but still seems to leak lots of memory if we call curl_global_init many times.
Definition at line 299 of file base.c.
◆ fr_curl_response_certinfo()
◆ fr_curl_tmp_handle()
CURL* fr_curl_tmp_handle |
( |
void |
| ) |
|
Return a thread local curl easy handle.
This should only be used for calls into libcurl functions which don't operate on an active request, like the escape/unescape functions.
- Returns
- A thread local curl easy handle.
- NULL on failure.
Definition at line 280 of file base.c.
◆ tls_config_dflt_capath()
◆ attr_tls_certificate
◆ curl_attr
Initial value:= {
{ NULL }
}
static fr_dict_t const * dict_freeradius
fr_dict_attr_t const * attr_tls_certificate
Attribute definitions for lib curl.
@ FR_TYPE_TLV
Contains nested attributes.
Definition at line 40 of file base.c.
◆ curl_dict
Initial value:
Definition at line 45 of file base.c.
◆ dict_freeradius
◆ fr_curl_autoinst
Initial value:= {
.name = "curl",
}
static int fr_curl_init(void)
Initialise global curl options.
static void fr_curl_free(void)
Definition at line 400 of file base.c.
◆ fr_curl_conn_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
#define FR_CONF_OFFSET_SUBSECTION(_name, _flags, _struct, _field, _subcs)
conf_parser_t which populates a sub-struct using a CONF_SECTION
static conf_parser_t reuse_curl_conn_config[]
Definition at line 99 of file base.c.
◆ fr_curl_sslcode_table
Initial value:= {
{
L(
"allow"), CURLUSESSL_TRY },
{
L(
"demand"), CURLUSESSL_ALL },
{
L(
"never"), CURLUSESSL_NONE },
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition at line 50 of file base.c.
◆ fr_curl_sslcode_table_len
◆ fr_curl_tls_config
Initial value:= {
},
.dflt = "allow" },
}
int cf_table_parse_int(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Generic function for parsing conf pair values as int.
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
@ CONF_FLAG_SECRET
Only print value if debug level >= 3.
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
static fr_table_num_sorted_t const fr_curl_sslcode_table[]
static size_t fr_curl_sslcode_table_len
static int tls_config_dflt_capath(CONF_PAIR **out, UNUSED void *parent, CONF_SECTION *cs, fr_token_t quote, conf_parser_t const *rule)
Definition at line 68 of file base.c.
◆ reuse_curl_conn_config
Initial value:= {
}
Tuneable parameters for slabs.
Definition at line 92 of file base.c.