summaryrefslogtreecommitdiffstats
path: root/contrib/hiredis/async.c
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 /contrib/hiredis/async.c
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 'contrib/hiredis/async.c')
-rw-r--r--contrib/hiredis/async.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/hiredis/async.c b/contrib/hiredis/async.c
index 851676263..4a2cadf8b 100644
--- a/contrib/hiredis/async.c
+++ b/contrib/hiredis/async.c
@@ -129,7 +129,6 @@ static redisAsyncContext *redisAsyncInitialize(redisContext *c) {
ac->onConnect = NULL;
ac->onDisconnect = NULL;
- ac->disconnectCbdata = NULL;
ac->replies.head = NULL;
ac->replies.tail = NULL;
@@ -216,10 +215,9 @@ int redisAsyncSetConnectCallback(redisAsyncContext *ac, redisConnectCallback *fn
return REDIS_ERR;
}
-int redisAsyncSetDisconnectCallback(redisAsyncContext *ac, redisDisconnectCallback *fn, void *cbdata) {
+int redisAsyncSetDisconnectCallback(redisAsyncContext *ac, redisDisconnectCallback *fn) {
if (ac->onDisconnect == NULL) {
ac->onDisconnect = fn;
- ac->disconnectCbdata = cbdata;
return REDIS_OK;
}
return REDIS_ERR;
@@ -308,10 +306,10 @@ static void __redisAsyncFree(redisAsyncContext *ac) {
* this context, the status will always be REDIS_OK. */
if (ac->onDisconnect && (c->flags & REDIS_CONNECTED)) {
if (c->flags & REDIS_FREEING) {
- ac->onDisconnect(ac,REDIS_OK,ac->disconnectCbdata);
+ ac->onDisconnect(ac,REDIS_OK);
} else {
c->flags |= REDIS_FREEING;
- ac->onDisconnect(ac,(ac->err == 0) ? REDIS_OK : REDIS_ERR,ac->disconnectCbdata);
+ ac->onDisconnect(ac,(ac->err == 0) ? REDIS_OK : REDIS_ERR);
}
}