Commit 63dcf9b7 authored by Blake Matheny's avatar Blake Matheny
Browse files

Make sure subscribe is still respected

parent 72688572
...@@ -362,12 +362,12 @@ void redisProcessCallbacks(redisAsyncContext *ac) { ...@@ -362,12 +362,12 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
* get a reply before pub/sub messages arrive. */ * get a reply before pub/sub messages arrive. */
if (__redisShiftCallback(&ac->replies,&cb) != REDIS_OK) { if (__redisShiftCallback(&ac->replies,&cb) != REDIS_OK) {
// error reply before any callbacks were setup // error reply before any callbacks were setup
if ( ((redisReply*)reply)->type == REDIS_REPLY_ERROR ) { if ( !(c->flags & REDIS_SUBSCRIBED) && ((redisReply*)reply)->type == REDIS_REPLY_ERROR ) {
c->err = REDIS_ERR_OTHER; c->err = REDIS_ERR_OTHER;
err_len = strlen(((redisReply*)reply)->str); err_len = strlen(((redisReply*)reply)->str);
err_len = err_len < (sizeof(c->errstr)-1) ? err_len : (sizeof(c->errstr)-1); err_len = err_len < (sizeof(c->errstr)-1) ? err_len : (sizeof(c->errstr)-1);
memcpy(c->errstr, ((redisReply*)reply)->str, err_len); memcpy(c->errstr, ((redisReply*)reply)->str, err_len);
c->errstr[err_len] = '\0'; c->errstr[err_len] = '\0';
__redisAsyncDisconnect(ac); __redisAsyncDisconnect(ac);
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment