summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-11-01 14:16:01 +0100
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-11-01 14:16:01 +0100
commit30a9f8f2715cba85cab1f06a4281cb780e198ddb (patch)
treed8d25640f367f520f542de62f9594c4b32416860
parentef995accb2bccf0c1a6ec95dd4810c599b9138f8 (diff)
Use existing function to append to the output buffer
-rw-r--r--async.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/async.c b/async.c
index 746cfce..d6a33f9 100644
--- a/async.c
+++ b/async.c
@@ -33,6 +33,9 @@
#include "sds.h"
#include "util.h"
+/* Forward declaration of function in hiredis.c */
+void __redisAppendCommand(redisContext *c, char *cmd, size_t len);
+
static redisAsyncContext *redisAsyncInitialize(redisContext *c) {
redisAsyncContext *ac = realloc(c,sizeof(redisAsyncContext));
/* Set all bytes in the async part of the context to 0 */
@@ -231,7 +234,7 @@ static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void
/* Don't accept new commands when the connection is lazily closed. */
if (c->flags & REDIS_DISCONNECTING) return REDIS_ERR;
- c->obuf = sdscatlen(c->obuf,cmd,len);
+ __redisAppendCommand(c,cmd,len);
/* Store callback */
cb.fn = fn;