diff options
author | Michael Grunder <michael.grunder@gmail.com> | 2021-05-02 12:26:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 12:26:05 -0700 |
commit | 667dbf536524ba3f28c1d964793db1055c5a64f2 (patch) | |
tree | 721da593129022fa5315e1142fc8d5662faef30b | |
parent | 9bf6c250e5e0ed7e68377f2986877959aaa95920 (diff) | |
parent | e06ecf7e45c6a976a2089240fe0b1eae3098e18a (diff) |
Merge pull request #935 from kristjanvalur/pr5
Bugfix: Ignore timeout callback from a successful connect (fixes #945)
-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) { |