summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristján Valur Jónsson <sweskman@gmail.com>2021-04-08 09:38:33 +0000
committerKristján Valur Jónsson <sweskman@gmail.com>2021-04-08 09:45:49 +0000
commite06ecf7e45c6a976a2089240fe0b1eae3098e18a (patch)
treec7ee5af50bed55d6b01b902fda2ee8c10e592312
parentdfa33e60b07c13328133a16065d88d171a2a61d4 (diff)
Ignore timeout callback from a successful connect
-rw-r--r--async.c14
1 files changed, 11 insertions, 3 deletions
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) {