Skip to content

Commit

Permalink
Make sure subscribe is still respected
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatheny committed May 24, 2011
1 parent 7268857 commit 63dcf9b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 63dcf9b

Please sign in to comment.