From 1c1fa16311aeaad3cb84bf6da3c403b9963ddc44 Mon Sep 17 00:00:00 2001 From: Date: Sun, 16 Mar 2008 21:16:45 -0700 Subject: [PATCH] Cleanup for defaults on new connection timeouts. --- libmemcached/memcached.c | 4 ++++ libmemcached/memcached_connect.c | 1 + libmemcached/murmur_hash.c | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libmemcached/memcached.c b/libmemcached/memcached.c index 31c12ab3..9d0f81e8 100644 --- a/libmemcached/memcached.c +++ b/libmemcached/memcached.c @@ -24,6 +24,8 @@ memcached_st *memcached_create(memcached_st *ptr) result_ptr= memcached_result_create(ptr, &ptr->result); WATCHPOINT_ASSERT(result_ptr); ptr->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT; + ptr->connect_timeout= MEMCACHED_DEFAULT_TIMEOUT; + ptr->retry_timeout= 0; ptr->distribution= MEMCACHED_DISTRIBUTION_MODULA; return ptr; @@ -89,6 +91,8 @@ memcached_st *memcached_clone(memcached_st *clone, memcached_st *ptr) new_clone->send_size= ptr->send_size; new_clone->recv_size= ptr->recv_size; new_clone->poll_timeout= ptr->poll_timeout; + new_clone->connect_timeout= ptr->connect_timeout; + new_clone->retry_timeout= ptr->retry_timeout; new_clone->distribution= ptr->distribution; new_clone->hash= ptr->hash; new_clone->user_data= ptr->user_data; diff --git a/libmemcached/memcached_connect.c b/libmemcached/memcached_connect.c index ab4b84f0..7edcce85 100644 --- a/libmemcached/memcached_connect.c +++ b/libmemcached/memcached_connect.c @@ -210,6 +210,7 @@ test_connect: { ptr->cached_errno= errno; WATCHPOINT_ERRNO(ptr->cached_errno); + WATCHPOINT_NUMBER(ptr->root->connect_timeout); close(ptr->fd); ptr->fd= -1; return MEMCACHED_ERRNO; diff --git a/libmemcached/murmur_hash.c b/libmemcached/murmur_hash.c index e673420d..7cfcaa9e 100644 --- a/libmemcached/murmur_hash.c +++ b/libmemcached/murmur_hash.c @@ -28,7 +28,6 @@ uint32_t murmur_hash(char *key, size_t length) case 2: k += key[1] << 8; case 1: k += key[0]; MIX(h,k,m); - default: }; h *= m; -- 2.30.2