diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-11-03 00:40:07 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-11-03 00:40:07 +0100 |
commit | e13674dd4e8e97e7401ed75b840176469a9b0046 (patch) | |
tree | 91c1e962fb50859cf806e79285c53af8182a8f7a | |
parent | 314c04840b5d576e7178f13e75a21b87e8bf01de (diff) |
Expose redisGetReplyFromReader as public API
-rw-r--r-- | hiredis.c | 6 | ||||
-rw-r--r-- | hiredis.h | 1 |
2 files changed, 4 insertions, 3 deletions
@@ -744,7 +744,7 @@ int redisBufferWrite(redisContext *c, int *done) { /* Internal helper function to try and get a reply from the reader, * or set an error in the context otherwise. */ -static int __redisGetReply(redisContext *c, void **reply) { +int redisGetReplyFromReader(redisContext *c, void **reply) { __redisCreateReplyReader(c); if (redisReplyReaderGetReply(c->reader,reply) == REDIS_ERR) { __redisSetError(c,REDIS_ERR_PROTOCOL, @@ -759,7 +759,7 @@ int redisGetReply(redisContext *c, void **reply) { void *aux = NULL; /* Try to read pending replies */ - if (__redisGetReply(c,&aux) == REDIS_ERR) + if (redisGetReplyFromReader(c,&aux) == REDIS_ERR) return REDIS_ERR; /* For the blocking context, flush output buffer and read reply */ @@ -774,7 +774,7 @@ int redisGetReply(redisContext *c, void **reply) { do { if (redisBufferRead(c) == REDIS_ERR) return REDIS_ERR; - if (__redisGetReply(c,&aux) == REDIS_ERR) + if (redisGetReplyFromReader(c,&aux) == REDIS_ERR) return REDIS_ERR; } while (aux == NULL); } @@ -130,6 +130,7 @@ int redisBufferWrite(redisContext *c, int *done); * buffer to the socket and reads until it has a reply. In a non-blocking * context, it will return unconsumed replies until there are no more. */ int redisGetReply(redisContext *c, void **reply); +int redisGetReplyFromReader(redisContext *c, void **reply); /* Write a command to the output buffer. Use these functions in blocking mode * to get a pipeline of commands. */ |