summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Matheny <bmatheny@mobocracy.net>2011-05-24 12:59:02 -0400
committerBlake Matheny <bmatheny@mobocracy.net>2011-05-24 12:59:02 -0400
commit63dcf9b741b5b1f7eebbcefab47b755a3fc0a9e2 (patch)
tree85f51e552fd537a40ab96cf5eff854e85e7da0e2
parent72688572548655cbd16178ae096f5d4b73ed03dc (diff)
Make sure subscribe is still respected
-rw-r--r--async.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/async.c b/async.c
index b085096..cd49d3c 100644
--- a/async.c
+++ b/async.c
@@ -362,12 +362,12 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
* get a reply before pub/sub messages arrive. */
if (__redisShiftCallback(&ac->replies,&cb) != REDIS_OK) {
// error reply before any callbacks were setup
- if ( ((redisReply*)reply)->type == REDIS_REPLY_ERROR ) {
- c->err = REDIS_ERR_OTHER;
- err_len = strlen(((redisReply*)reply)->str);
- err_len = err_len < (sizeof(c->errstr)-1) ? err_len : (sizeof(c->errstr)-1);
- memcpy(c->errstr, ((redisReply*)reply)->str, err_len);
- c->errstr[err_len] = '\0';
+ if ( !(c->flags & REDIS_SUBSCRIBED) && ((redisReply*)reply)->type == REDIS_REPLY_ERROR ) {
+ c->err = REDIS_ERR_OTHER;
+ err_len = strlen(((redisReply*)reply)->str);
+ err_len = err_len < (sizeof(c->errstr)-1) ? err_len : (sizeof(c->errstr)-1);
+ memcpy(c->errstr, ((redisReply*)reply)->str, err_len);
+ c->errstr[err_len] = '\0';
__redisAsyncDisconnect(ac);
return;
}