29RCSIDH(redis_io_h,
"$Id: e411f32350816d9b7dffd350a5e0ab951756c87a $")
32#include <freeradius-devel/redis/base.h>
33#include <freeradius-devel/util/event.h>
34#include <freeradius-devel/server/connection.h>
41#include <freeradius-devel/tls/strerror.h>
44#include <hiredis/async.h>
84 redisAsyncContext *
ac;
157 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 void * fr_dlist_remove(fr_dlist_head_t *list_head, void *ptr)
Remove an item from the list.
static int fr_dlist_insert_tail(fr_dlist_head_t *list_head, void *ptr)
Insert an item into the tail of a list.
Head of a doubly linked list.
Entry in a doubly linked list.
redisAsyncContext * fr_redis_connection_get_async_ctx(connection_t *conn)
Return the redisAsyncContext associated with the connection.
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_dlist_head_t ignore
Contains SQNs for responses that should be ignored.
fr_event_fd_t * fd_ev
IO event.
char const * username
to authenticate to Redis.
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.
fr_timer_t * timer_ev
Connection timer.
uint32_t database
number on Redis server.
char const * password
to authenticate to Redis.
bool write_set
We're listening for writes.
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.
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.
bool freeing
Ensure that redisAsyncFree doesn't cause a callback loop.
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.
A file descriptor/filter event.
Stores all information relating to an event list.
void check(const char *name, int index, const struct info *all, int want_lineno, const char *want_function, const char *want_file, int *failed)
static fr_event_list_t * el