uint32_t cursor_server;
int cached_errno;
struct {
+ bool auto_eject_hosts:1;
+ bool binary_protocol:1;
+ bool buffer_requests:1;
+ bool hash_with_prefix_key:1;
+ bool ketama_weighted:1;
bool no_block:1;
- bool tcp_nodelay:1;
+ bool no_reply:1;
+ bool randomize_replica_read:1;
bool reuse_memory:1;
- bool use_md5:1;
- bool use_crc:1;
- bool use_cache_lookups:1;
bool support_cas:1;
- bool buffer_requests:1;
+ bool tcp_nodelay:1;
+ bool use_cache_lookups:1;
bool use_sort_hosts:1;
- bool verify_key:1;
- bool ketama_weighted:1;
- bool binary_protocol:1;
- bool hash_with_prefix_key:1;
- bool no_reply:1;
bool use_udp:1;
- bool auto_eject_hosts:1;
- bool randomize_replica_read:1;
+ bool verify_key:1;
} flags;
int32_t poll_timeout;
int32_t connect_timeout;
test_truth(memc_clone->flags.no_block == memc->flags.no_block);
test_truth(memc_clone->flags.tcp_nodelay == memc->flags.tcp_nodelay);
test_truth(memc_clone->flags.reuse_memory == memc->flags.reuse_memory);
- test_truth(memc_clone->flags.use_md5 == memc->flags.use_md5);
- test_truth(memc_clone->flags.use_crc == memc->flags.use_crc);
test_truth(memc_clone->flags.use_cache_lookups == memc->flags.use_cache_lookups);
test_truth(memc_clone->flags.support_cas == memc->flags.support_cas);
test_truth(memc_clone->flags.buffer_requests == memc->flags.buffer_requests);
uint32_t server_idx = memcached_generate_hash(memc, key, strlen(key));
char *hostname = memc->hosts[server_idx].hostname;
- unsigned int port = memc->hosts[server_idx].port;
+ in_port_t port = memc->hosts[server_idx].port;
fprintf(fp, "key %s is on host /%s:%u\n", key, hostname, port);
}
fclose(fp);
* This is to verify correct behavior in the library. Fake that two servers
* are dead..
*/
- unsigned int port0= memc->hosts[0].port;
- unsigned int port2= memc->hosts[2].port;
+ in_port_t port0= memc->hosts[0].port;
+ in_port_t port2= memc->hosts[2].port;
+
memc->hosts[0].port= 0;
memc->hosts[2].port= 0;
/* Remove half of the objects */
for (int x= 0; x < (int)max_keys; ++x)
+ {
if (x & 1)
{
rc= memcached_delete(memc, keys[x], key_length[x], 0);
assert(rc == MEMCACHED_SUCCESS);
}
+ }
memcached_quit(memc);
memc->hosts[0].port= 0;
/* restore the memc handle */
memc->hosts[0].port= port0;
memc->hosts[2].port= port2;
+
return TEST_SUCCESS;
}