Skip to content

Commit

Permalink
Ignore timeout callback from a successful connect
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Apr 8, 2021
1 parent 6c4cb6c commit 5080117
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 5080117

Please sign in to comment.