X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached_connect.c;h=4bfc710fa23e9c1543de27c46da52bbfa37d6116;hb=5ed23cb1d7aaa03f05b58dfeabeee72f5aff91c5;hp=50c6fa62acacd3e40823909343586735cce5d093;hpb=85a0b3bc944db78c070961cd3a48b8e34dcef8a4;p=m6w6%2Flibmemcached diff --git a/lib/memcached_connect.c b/lib/memcached_connect.c index 50c6fa62..4bfc710f 100644 --- a/lib/memcached_connect.c +++ b/lib/memcached_connect.c @@ -246,6 +246,13 @@ test_connect: WATCHPOINT_ERRNO(ptr->cached_errno); close(ptr->fd); ptr->fd= -1; + if (ptr->root->retry_timeout) + { + struct timeval next_time; + + gettimeofday(&next_time, NULL); + ptr->next_retry= next_time.tv_sec + ptr->root->retry_timeout; + } } } else @@ -269,6 +276,14 @@ memcached_return memcached_connect(memcached_server_st *ptr) memcached_return rc= MEMCACHED_NO_SERVERS; LIBMEMCACHED_MEMCACHED_CONNECT_START(); + if (ptr->root->retry_timeout) + { + struct timeval next_time; + + gettimeofday(&next_time, NULL); + if (next_time.tv_sec < ptr->next_retry) + return MEMCACHED_TIMEOUT; + } /* We need to clean up the multi startup piece */ switch (ptr->type) {