From: Date: Tue, 14 Apr 2009 14:20:57 +0000 (-0700) Subject: Fix for by_key() X-Git-Tag: 0.28~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5f5b6bee7198f7091e2ed96ea52279efe0f3c472;p=m6w6%2Flibmemcached Fix for by_key() --- diff --git a/ChangeLog b/ChangeLog index fb63d43a..aba357e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +0.28 + * Fixed bug in init sructure (reapplied) + * Fixed bug in get/set by key (nikkhils@gmail.com) + 0.27 Sun Mar 29 22:33:01 PDT 2009 * Added new UDP fire-forget mode. * Reworked performance for mget() to better make use of async protocol diff --git a/libmemcached/memcached_get.c b/libmemcached/memcached_get.c index 96882864..04189956 100644 --- a/libmemcached/memcached_get.c +++ b/libmemcached/memcached_get.c @@ -124,7 +124,7 @@ memcached_return memcached_mget_by_key(memcached_st *ptr, memcached_return rc= MEMCACHED_NOTFOUND; char *get_command= "get "; uint8_t get_command_length= 4; - unsigned int master_server_key= 0; + unsigned int master_server_key= -1; /* 0 is a valid server id! */ if (ptr->flags & MEM_USE_UDP) return MEMCACHED_NOT_SUPPORTED; @@ -186,7 +186,7 @@ memcached_return memcached_mget_by_key(memcached_st *ptr, { unsigned int server_key; - if (master_server_key) + if (master_server_key != -1) server_key= master_server_key; else server_key= memcached_generate_hash(ptr, keys[x], key_length[x]);