29 RCSIDH(redis_io_h,
"$Id: a027da416621b73fe9ea483a71b5a68ce52e2fb0 $")
31 #include <freeradius-devel/redis/base.h>
32 #include <freeradius-devel/util/event.h>
33 #include <freeradius-devel/server/connection.h>
35 #include <hiredis/async.h>
74 redisAsyncContext *
ac;
144 char const *log_prefix);
static void * fr_dlist_head(fr_dlist_head_t const *list_head)
Return the HEAD item of a list or NULL if the list is empty.
static int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
static void * fr_dlist_remove(fr_dlist_head_t *list_head, void *ptr)
Remove an item from the list.
Head of a doubly linked list.
Entry in a doubly linked list.
fr_redis_sqn_t rsp_sqn
Current redis response number.
bool read_set
We're listening for reads.
redisAsyncContext * ac
Async handle for hiredis.
fr_event_timer_t const * timer
Connection timer.
fr_dlist_head_t ignore
Contains SQNs for responses that should be ignored.
static void fr_redis_connection_ignore_response(fr_redis_handle_t *h, fr_redis_sqn_t sqn)
Ignore a response with a specific sequence number.
bool ignore_disconnect_cb
Ensure that redisAsyncFree doesn't cause a callback loop.
connection_t * fr_redis_connection_alloc(TALLOC_CTX *ctx, fr_event_list_t *el, connection_conf_t const *conn_conf, fr_redis_io_conf_t const *io_conf, char const *log_prefix)
Allocate an async redis I/O connection.
uint32_t database
number on Redis server.
char const * password
to authenticate to Redis.
bool write_set
We're listening for writes.
static bool fr_redis_connection_process_response(fr_redis_handle_t *h)
Update the response sequence number and check if we should ignore the response.
fr_time_delta_t reconnection_delay
fr_time_delta_t connection_timeout
redisAsyncContext * fr_redis_connection_get_async_ctx(connection_t *conn)
Return the redisAsyncContext associated with the connection.
static fr_redis_sqn_t fr_redis_connection_sent_request(fr_redis_handle_t *h)
Tell the handle we sent a command, and get the SQN that command was assigned.
fr_redis_sqn_t req_sqn
Current redis request number.
Stores all information relating to an event list.
#define check(_handle, _len_p)
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
A time delta, a difference in time measured in nanoseconds.
static fr_event_list_t * el