X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fhash.c;h=abad4f5bf3bce3951ee0f019560a733addca00fa;hb=f0d3a824ed9acb9f6e3080683abe2bcc8b0cd6bd;hp=b418d2e1188fe48c130b77e89b0c7d5f0150c457;hpb=ba24508f51eed2af4f0192589801db2f945eac7b;p=awesomized%2Flibmemcached diff --git a/libmemcached/hash.c b/libmemcached/hash.c index b418d2e1..abad4f5b 100644 --- a/libmemcached/hash.c +++ b/libmemcached/hash.c @@ -70,7 +70,7 @@ static inline uint32_t _generate_hash_wrapper(const memcached_st *ptr, const cha WATCHPOINT_ASSERT(memcached_server_count(ptr)); if (memcached_server_count(ptr) == 1) - return 0; + return EXIT_SUCCESS; if (ptr->flags.hash_with_prefix_key) { @@ -78,7 +78,7 @@ static inline uint32_t _generate_hash_wrapper(const memcached_st *ptr, const cha char temp[temp_length]; if (temp_length > MEMCACHED_MAX_KEY -1) - return 0; + return EXIT_SUCCESS; strncpy(temp, ptr->prefix_key, ptr->prefix_key_length); strncpy(temp + ptr->prefix_key_length, key, key_length); @@ -124,7 +124,15 @@ uint32_t memcached_generate_hash(const memcached_st *ptr, const char *key, size_ return dispatch_host(ptr, _generate_hash_wrapper(ptr, key, key_length)); } -hashkit_st *memcached_get_hashkit(memcached_st *ptr) +const hashkit_st *memcached_get_hashkit(const memcached_st *ptr) { return &ptr->hashkit; } + +memcached_return_t memcached_set_hashkit(memcached_st *self, hashkit_st *hashk) +{ + hashkit_free(&self->hashkit); + hashkit_clone(&self->hashkit, hashk); + + return MEMCACHED_SUCCESS; +}