projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Committing work for next release (got to do something over lunch aye?)
[m6w6/libmemcached]
/
lib
/
memcached_hash.c
diff --git
a/lib/memcached_hash.c
b/lib/memcached_hash.c
index 9cc846a80e8ab568b047d4b7e8c9896a9b4f9da9..87c59d510ae55cbc32cff6def7d1817acd8104b6 100644
(file)
--- a/
lib/memcached_hash.c
+++ b/
lib/memcached_hash.c
@@
-85,18
+85,18
@@
unsigned int memcached_generate_hash(memcached_st *ptr, char *key, size_t key_le
}
WATCHPOINT_ASSERT(hash);
}
WATCHPOINT_ASSERT(hash);
- if (ptr->flags & MEM_USE_KETAMA)
+
+ if (ptr->distribution == MEMCACHED_DISTRIBUTION_MODULA)
{
{
- WATCHPOINT_ASSERT(0);
- return 0;
+ return hash % ptr->number_of_hosts;
}
else
{
unsigned int server_key;
}
else
{
unsigned int server_key;
- server_key= hash %
ptr->number_of_hosts
;
+ server_key= hash %
MEMCACHED_WHEEL_SIZE
;
- return
server_key
;
+ return
ptr->wheel[server_key]
;
}
}
}
}