aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@atlas.cz>2020-03-29 01:06:54 +0100
committerPetr Vaněk <arkamar@atlas.cz>2020-03-29 12:17:59 +0200
commit544cea204e2f085625b024ea5ad6ff7d0437e1eb (patch)
tree6c0746e78d8285c33ebcdc86910c1833502ca24d /src
parent192c6b791d1c2b42861df6526c663f1d0814ee84 (diff)
downloadrspamd-544cea204e2f085625b024ea5ad6ff7d0437e1eb.tar.gz
rspamd-544cea204e2f085625b024ea5ad6ff7d0437e1eb.zip
Revert "[Fix] Fix hiredis stupidity" and use the hiredis api as intended
This reverts commit b05b9bf904edce75c17e63982d5e0a82dd3e9064.
Diffstat (limited to 'src')
-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 57fc734f9..2d2510753 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,