diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-08 15:25:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-08 15:25:12 +0100 |
commit | b05b9bf904edce75c17e63982d5e0a82dd3e9064 (patch) | |
tree | 517c034b22cb5863c488422687de88847e492571 /contrib/hiredis/async.c | |
parent | 2996fbba0a369032f96c0d6689ae2b6b623065d4 (diff) | |
download | rspamd-b05b9bf904edce75c17e63982d5e0a82dd3e9064.tar.gz rspamd-b05b9bf904edce75c17e63982d5e0a82dd3e9064.zip |
[Fix] Fix hiredis stupidity
Diffstat (limited to 'contrib/hiredis/async.c')
-rw-r--r-- | contrib/hiredis/async.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/hiredis/async.c b/contrib/hiredis/async.c index d955203f8..84c43585c 100644 --- a/contrib/hiredis/async.c +++ b/contrib/hiredis/async.c @@ -129,6 +129,7 @@ static redisAsyncContext *redisAsyncInitialize(redisContext *c) { ac->onConnect = NULL; ac->onDisconnect = NULL; + ac->disconnectCbdata = NULL; ac->replies.head = NULL; ac->replies.tail = NULL; @@ -215,9 +216,10 @@ int redisAsyncSetConnectCallback(redisAsyncContext *ac, redisConnectCallback *fn return REDIS_ERR; } -int redisAsyncSetDisconnectCallback(redisAsyncContext *ac, redisDisconnectCallback *fn) { +int redisAsyncSetDisconnectCallback(redisAsyncContext *ac, redisDisconnectCallback *fn, void *cbdata) { if (ac->onDisconnect == NULL) { ac->onDisconnect = fn; + ac->disconnectCbdata = cbdata; return REDIS_OK; } return REDIS_ERR; @@ -306,9 +308,9 @@ 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->onDisconnect(ac,REDIS_OK,ac->disconnectCbdata); } else { - ac->onDisconnect(ac,(ac->err == 0) ? REDIS_OK : REDIS_ERR); + ac->onDisconnect(ac,(ac->err == 0) ? REDIS_OK : REDIS_ERR,ac->disconnectCbdata); } } |