aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/redis_pool.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-24 15:08:40 +0100
committerGitHub <noreply@github.com>2020-04-24 15:08:40 +0100
commit4e269dc2f8c58fe923b42717b7ea5bcc55bde25d (patch)
treeee2e86a2d475dc470b87fc184bd6ec2afe514e4c /src/libserver/redis_pool.c
parent5088000ff5670eec3ef588061a0c03f272f1d88c (diff)
parent544cea204e2f085625b024ea5ad6ff7d0437e1eb (diff)
downloadrspamd-4e269dc2f8c58fe923b42717b7ea5bcc55bde25d.tar.gz
rspamd-4e269dc2f8c58fe923b42717b7ea5bcc55bde25d.zip
Merge pull request #3313 from arkamar/hiredis
Revert "[Fix] Fix hiredis stupidity" and use the hiredis api as intended
Diffstat (limited to 'src/libserver/redis_pool.c')
-rw-r--r--src/libserver/redis_pool.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c
index 4d1a18676..7e835013c 100644
--- a/src/libserver/redis_pool.c
+++ b/src/libserver/redis_pool.c
@@ -258,10 +258,9 @@ rspamd_redis_pool_schedule_timeout (struct rspamd_redis_pool_connection *conn)
}
static void
-rspamd_redis_pool_on_disconnect (const struct redisAsyncContext *ac, int status,
- void *ud)
+rspamd_redis_pool_on_disconnect (const struct redisAsyncContext *ac, int status)
{
- struct rspamd_redis_pool_connection *conn = ud;
+ struct rspamd_redis_pool_connection *conn = ac->data;
/*
* Here, we know that redis itself will free this connection
@@ -313,13 +312,13 @@ rspamd_redis_pool_new_connection (struct rspamd_redis_pool *pool,
g_hash_table_insert (elt->pool->elts_by_ctx, ctx, conn);
g_queue_push_head_link (elt->active, conn->entry);
conn->ctx = ctx;
+ ctx->data = conn;
rspamd_random_hex (conn->tag, sizeof (conn->tag));
REF_INIT_RETAIN (conn, rspamd_redis_pool_conn_dtor);
msg_debug_rpool ("created new connection to %s:%d: %p", ip, port, ctx);
redisLibevAttach (pool->event_loop, ctx);
- redisAsyncSetDisconnectCallback (ctx, rspamd_redis_pool_on_disconnect,
- conn);
+ redisAsyncSetDisconnectCallback (ctx, rspamd_redis_pool_on_disconnect);
if (password) {
redisAsyncCommand (ctx, NULL, NULL,