test_true(memc_clone->flags.buffer_requests == memc->flags.buffer_requests);
test_true(memc_clone->flags.use_sort_hosts == memc->flags.use_sort_hosts);
test_true(memc_clone->flags.verify_key == memc->flags.verify_key);
- test_true(memc_clone->flags.ketama_weighted == memc->flags.ketama_weighted);
+ test_true(memc_clone->ketama.weighted == memc->ketama.weighted);
test_true(memc_clone->flags.binary_protocol == memc->flags.binary_protocol);
test_true(memc_clone->flags.hash_with_prefix_key == memc->flags.hash_with_prefix_key);
test_true(memc_clone->flags.no_reply == memc->flags.no_reply);
/* VDEAAAAA hashes to fffcd1b5, after the last continuum point, and lets
* us test the boundary wraparound.
*/
- test_true(memcached_generate_hash(memc, (char *)"VDEAAAAA", 8) == memc->continuum[0].index);
+ test_true(memcached_generate_hash(memc, (char *)"VDEAAAAA", 8) == memc->ketama.continuum[0].index);
/* verify the standard ketama set. */
for (x= 0; x < 99; x++)
instance= memcached_server_instance_by_position(memc, 2);
((memcached_server_write_instance_st)instance)->next_retry = time(NULL) + 15;
- memc->next_distribution_rebuild= time(NULL) - 1;
+ memc->ketama.next_distribution_rebuild= time(NULL) - 1;
/*
This would not work if there were only two hosts.
/* and re-added when it's back. */
((memcached_server_write_instance_st)instance)->next_retry = time(NULL) - 1;
- memc->next_distribution_rebuild= time(NULL) - 1;
+ memc->ketama.next_distribution_rebuild= time(NULL) - 1;
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION,
memc->distribution);
for (size_t x= 0; x < 99; x++)
/* VDEAAAAA hashes to fffcd1b5, after the last continuum point, and lets
* us test the boundary wraparound.
*/
- test_true(memcached_generate_hash(memc, (char *)"VDEAAAAA", 8) == memc->continuum[0].index);
+ test_true(memcached_generate_hash(memc, (char *)"VDEAAAAA", 8) == memc->ketama.continuum[0].index);
/* verify the standard ketama set. */
for (x= 0; x < 99; x++)
{
memcached_return_t rc;
uint64_t value;
- int x;
memcached_server_st *server_pool;
memcached_st *memc;
/* VDEAAAAA hashes to fffcd1b5, after the last continuum point, and lets
* us test the boundary wraparound.
*/
- test_true(memcached_generate_hash(memc, (char *)"VDEAAAAA", 8) == memc->continuum[0].index);
+ test_true(memcached_generate_hash(memc, (char *)"VDEAAAAA", 8) == memc->ketama.continuum[0].index);
/* verify the standard ketama set. */
- for (x= 0; x < 99; x++)
+ for (uint32_t x= 0; x < 99; x++)
{
uint32_t server_idx= memcached_generate_hash(memc, ketama_test_cases_spy[x].key, strlen(ketama_test_cases_spy[x].key));
test_true_got(rc == MEMCACHED_SUCCESS, memcached_strerror(NULL, rc));
test_true(string);
free(string);
+ memcached_free(memc_clone);
return TEST_SUCCESS;
}