From: Date: Fri, 21 Nov 2008 23:45:23 +0000 (-0800) Subject: Patch from evn X-Git-Tag: 0.25~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=bdb7897b42e740471cc02589eda4434a09bbd330;p=m6w6%2Flibmemcached Patch from evn --- bdb7897b42e740471cc02589eda4434a09bbd330 diff --cc libmemcached/memcached_hash.c index ff7d0e39,ff7d0e39..29c8d048 --- a/libmemcached/memcached_hash.c +++ b/libmemcached/memcached_hash.c @@@ -131,7 -131,7 +131,7 @@@ static uint32_t dispatch_host(memcached else right= middle; } -- if (right > end) ++ if (right == end) right= begin; return right->index; } diff --cc tests/function.c index 4ec247f6,4ec247f6..b6850288 --- a/tests/function.c +++ b/tests/function.c @@@ -2161,7 -2161,7 +2161,12 @@@ test_return user_supplied_bug18(memcach assert(strcmp(server_pool[7].hostname, "10.0.1.8") == 0); assert(server_pool[7].port == 11211); assert(server_pool[7].weight == 100); -- ++ ++ /* VDEAAAAA hashes to fffcd1b5, after the last continuum point, and lets ++ * us test the boundary wraparound. ++ */ ++ assert(memcached_generate_hash(memc, (unsigned char *)"VDEAAAAA", 8) == memc->continuum[0].index); ++ /* verify the standard ketama set. */ for (i= 0; i < 99; i++) {