Skip to content

Commit

Permalink
Merge pull request #935 from kristjanvalur/pr5
Browse files Browse the repository at this point in the history
Bugfix: Ignore timeout callback from a successful connect (fixes #945)
  • Loading branch information
michael-grunder authored May 2, 2021
2 parents 9bf6c25 + e06ecf7 commit 667dbf5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions async.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,17 @@ void redisAsyncHandleTimeout(redisAsyncContext *ac) {
redisContext *c = &(ac->c);
redisCallback cb;

if ((c->flags & REDIS_CONNECTED) && ac->replies.head == NULL) {
/* Nothing to do - just an idle timeout */
return;
if ((c->flags & REDIS_CONNECTED)) {
if ( ac->replies.head == NULL) {
/* Nothing to do - just an idle timeout */
return;
}

if (!ac->c.command_timeout ||
(!ac->c.command_timeout->tv_sec && !ac->c.command_timeout->tv_usec)) {
/* A belated connect timeout arriving, ignore */
return;
}
}

if (!c->err) {
Expand Down

0 comments on commit 667dbf5

Please sign in to comment.