From e06ecf7e45c6a976a2089240fe0b1eae3098e18a Mon Sep 17 00:00:00 2001 From: Kristján Valur Jónsson Date: Thu, 8 Apr 2021 09:38:33 +0000 Subject: Ignore timeout callback from a successful connect --- async.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'async.c') diff --git a/async.c b/async.c index dd78dda..3f31286 100644 --- a/async.c +++ b/async.c @@ -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) { -- cgit v1.2.3