diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | libmemcached/memcached_connect.c | 7 | ||||
-rw-r--r-- | libmemcached/memcached_constants.h | 2 |
4 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,4 @@ + * Changed default timeout to 1 second for poll timeouts * Wheel uses less memory/dynamic allocation for size (no longer limited to 512 hosts by default. * memslap memory leak fix @@ -9,3 +9,4 @@ Kevin Dalley - Bug Fixes Patrick Galbraith - work on C++ interface Ross McFarland - Idea for sorting servers. Marcelo Fernandez - TCP/IP timeout pieces +Yin Chen - Ketama support diff --git a/libmemcached/memcached_connect.c b/libmemcached/memcached_connect.c index 5531ad79..74469870 100644 --- a/libmemcached/memcached_connect.c +++ b/libmemcached/memcached_connect.c @@ -207,7 +207,11 @@ test_connect: fds[0].events= POLLOUT | POLLERR; error= poll(fds, 1, ptr->root->connect_timeout); - if (error != 1) + if (error == 0) + { + goto handle_retry; + } + else if (error != 1) { ptr->cached_errno= errno; WATCHPOINT_ERRNO(ptr->cached_errno); @@ -225,6 +229,7 @@ test_connect: case EISCONN: /* We were spinning waiting on connect */ break; default: +handle_retry: ptr->cached_errno= errno; WATCHPOINT_ERRNO(ptr->cached_errno); close(ptr->fd); diff --git a/libmemcached/memcached_constants.h b/libmemcached/memcached_constants.h index 1d2b08ad..cb7b2095 100644 --- a/libmemcached/memcached_constants.h +++ b/libmemcached/memcached_constants.h @@ -22,7 +22,7 @@ extern "C" { #define MEMCACHED_POINTS_PER_SERVER 100 #define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */ #define MEMCACHED_STRIDE 4 -#define MEMCACHED_DEFAULT_TIMEOUT INT32_MAX +#define MEMCACHED_DEFAULT_TIMEOUT 1000 #define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should build for in the continuum */ typedef enum { |