diff options
author | Kristján Valur Jónsson <sweskman@gmail.com> | 2021-04-08 09:38:33 +0000 |
---|---|---|
committer | Kristján Valur Jónsson <sweskman@gmail.com> | 2021-04-08 09:45:49 +0000 |
commit | e06ecf7e45c6a976a2089240fe0b1eae3098e18a (patch) | |
tree | c7ee5af50bed55d6b01b902fda2ee8c10e592312 | |
parent | dfa33e60b07c13328133a16065d88d171a2a61d4 (diff) |
Ignore timeout callback from a successful connect
-rw-r--r-- | async.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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) { |