Commit e06ecf7e authored by Kristján Valur Jónsson's avatar Kristján Valur Jónsson
Browse files

Ignore timeout callback from a successful connect

parent dfa33e60
...@@ -690,11 +690,19 @@ void redisAsyncHandleTimeout(redisAsyncContext *ac) { ...@@ -690,11 +690,19 @@ void redisAsyncHandleTimeout(redisAsyncContext *ac) {
redisContext *c = &(ac->c); redisContext *c = &(ac->c);
redisCallback cb; redisCallback cb;
if ((c->flags & REDIS_CONNECTED) && ac->replies.head == NULL) { if ((c->flags & REDIS_CONNECTED)) {
if ( ac->replies.head == NULL) {
/* Nothing to do - just an idle timeout */ /* Nothing to do - just an idle timeout */
return; 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) { if (!c->err) {
__redisSetError(c, REDIS_ERR_TIMEOUT, "Timeout"); __redisSetError(c, REDIS_ERR_TIMEOUT, "Timeout");
__redisAsyncCopyError(ac); __redisAsyncCopyError(ac);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment