WATCHPOINT_NUMBER(ptr->root->connect_timeout);
close(ptr->fd);
ptr->fd= -1;
+ if (ptr->address_info)
+ {
+ freeaddrinfo(ptr->address_info);
+ ptr->address_info= NULL;
+ }
+
return MEMCACHED_ERRNO;
}
default:
handle_retry:
ptr->cached_errno= errno;
- WATCHPOINT_ERRNO(ptr->cached_errno);
close(ptr->fd);
ptr->fd= -1;
if (ptr->root->retry_timeout)
WATCHPOINT_ASSERT(0);
}
- if (rc != MEMCACHED_SUCCESS)
- WATCHPOINT_ERROR(rc);
-
LIBMEMCACHED_MEMCACHED_CONNECT_END();
return rc;
for (x= 0; x < servers->count; x++)
if (servers[x].address_info)
+ {
freeaddrinfo(servers[x].address_info);
+ servers[x].address_info= NULL;
+ }
if (ptr && ptr->call_free)
ptr->call_free(ptr, servers);
sizeof(memcached_server_st) * (count + ptr->number_of_hosts));
if (!new_host_list)
+ {
+ assert(0);
return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
+ }
ptr->hosts= new_host_list;
return 0;
}
+test_return get_read_count(memcached_st *memc)
+{
+ unsigned int x;
+ memcached_return rc;
+ memcached_st *clone;
+
+ clone= memcached_clone(NULL, memc);
+ assert(clone);
+
+ memcached_server_add(clone, "localhost", 6666);
+
+ {
+ char *return_value;
+ size_t return_value_length;
+ uint32_t flags;
+ uint32_t count;
+
+ for (x= count= 0; x < global_count; x++)
+ {
+ return_value= memcached_get(clone, global_keys[x], global_keys_length[x],
+ &return_value_length, &flags, &rc);
+ if (rc == MEMCACHED_SUCCESS)
+ {
+ count++;
+ if (return_value)
+ free(return_value);
+ }
+ }
+ fprintf(stderr, "\t%u -> %u", global_count, count);
+ }
+
+ memcached_free(clone);
+
+ return 0;
+}
+
test_return get_read(memcached_st *memc)
{
unsigned int x;
{0, 0, 0}
};
+test_st consistent_tests[] ={
+ {"generate_pairs", 1, generate_pairs },
+ {"generate_data", 1, generate_data },
+ {"get_read", 0, get_read_count },
+ {"cleanup", 1, cleanup_pairs },
+ {0, 0, 0}
+};
collection_st collection[] ={
{"block", 0, 0, tests},
{"generate_md5", pre_md5, 0, generate_tests},
{"generate_murmur", pre_murmur, 0, generate_tests},
{"generate_nonblock", pre_nonblock, 0, generate_tests},
+ {"consistent_not", 0, 0, consistent_tests},
+ {"consistent_ketama", pre_behavior_ketama, 0, consistent_tests},
+ {"consistent_wheel", enable_wheel, 0, consistent_tests},
{0, 0, 0, 0}
};