projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge
[m6w6/libmemcached]
/
libmemcached
/
memcached_hosts.c
diff --git
a/libmemcached/memcached_hosts.c
b/libmemcached/memcached_hosts.c
index 34b93c6f4d3b703569d06d2f0a6d59e31a84718b..eb8f45e5f37b61a9b8c6dee2ca2116f363d569d6 100644
(file)
--- a/
libmemcached/memcached_hosts.c
+++ b/
libmemcached/memcached_hosts.c
@@
-89,9
+89,10
@@
void server_list_free(memcached_st *ptr, memcached_server_st *servers)
static int continuum_item_cmp(const void *t1, const void *t2)
{
static int continuum_item_cmp(const void *t1, const void *t2)
{
- memcached_continuum_item_st *ct1
= (memcached_continuum_item_st *)t1;
- memcached_continuum_item_st *ct2
= (memcached_continuum_item_st *)t2;
+ memcached_continuum_item_st *ct1= (memcached_continuum_item_st *)t1;
+ memcached_continuum_item_st *ct2= (memcached_continuum_item_st *)t2;
+ /* Why 153? Hmmm... */
WATCHPOINT_ASSERT(ct1->value != 153);
if (ct1->value == ct2->value)
return 0;
WATCHPOINT_ASSERT(ct1->value != 153);
if (ct1->value == ct2->value)
return 0;
@@
-169,10
+170,13
@@
memcached_return update_continuum(memcached_st *ptr)
pointer_counter+= pointer_per_server;
}
pointer_counter+= pointer_per_server;
}
+ WATCHPOINT_ASSERT(ptr);
+ WATCHPOINT_ASSERT(ptr->continuum);
+ WATCHPOINT_ASSERT(ptr->number_of_hosts);
WATCHPOINT_ASSERT(ptr->number_of_hosts * MEMCACHED_POINTS_PER_SERVER <= MEMCACHED_CONTINUUM_SIZE);
WATCHPOINT_ASSERT(ptr->number_of_hosts * MEMCACHED_POINTS_PER_SERVER <= MEMCACHED_CONTINUUM_SIZE);
- qsort(ptr->continuum, ptr->number_of_hosts * MEMCACHED_POINTS_PER_SERVER, sizeof(memcached_continuum_item_st), continuum_item_cmp);
-
ptr->continuum_points_counter= pointer_counter;
ptr->continuum_points_counter= pointer_counter;
+ qsort(ptr->continuum, ptr->continuum_points_counter, sizeof(memcached_continuum_item_st), continuum_item_cmp);
+
if (stat_p)
memcached_stat_free(NULL, stat_p);
if (stat_p)
memcached_stat_free(NULL, stat_p);