#include <libmemcached/options.hpp>
#include <libmemcached/virtual_bucket.h>
-#if 0
-static const memcached_st global_copy= {
- .state= {
- .is_purging= false, // .is_purging
- .is_processing_input= false, // is_processing_input
- .is_time_for_rebuild= false,
- },
- .flags= {
- .auto_eject_hosts= false,
- .binary_protocol= false,
- .buffer_requests= false,
- .hash_with_namespace= false,
- .no_block= false,
- .no_reply= false,
- .randomize_replica_read= false,
- .support_cas= false,
- .tcp_nodelay= false,
- .use_sort_hosts= false,
- .use_udp= false,
- .verify_key= false,
- .tcp_keepalive= false,
- },
-};
-#endif
-
static inline bool _memcached_init(memcached_st *self)
{
self->state.is_purging= false;
self->flags.buffer_requests= false;
self->flags.hash_with_namespace= false;
self->flags.no_block= false;
- self->flags.no_reply= false;
+ self->flags.reply= true;
self->flags.randomize_replica_read= false;
self->flags.support_cas= false;
self->flags.tcp_nodelay= false;
self->virtual_bucket= NULL;
- self->distribution= MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY;
+ self->distribution= MEMCACHED_DISTRIBUTION_MODULA;
if (hashkit_create(&self->hashkit) == NULL)
{
self->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT;
self->connect_timeout= MEMCACHED_DEFAULT_CONNECT_TIMEOUT;
self->retry_timeout= MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT;
+ self->dead_timeout= MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT;
self->send_size= -1;
self->recv_size= -1;
ptr->configure.filename= NULL;
}
- if (memcached_is_allocated(ptr) && release_st)
+ hashkit_free(&ptr->hashkit);
+
+ if (memcached_is_allocated(ptr) and release_st)
{
libmemcached_free(ptr, ptr);
}
memcached_return_t memcached_reset(memcached_st *ptr)
{
WATCHPOINT_ASSERT(ptr);
- if (not ptr)
+ if (ptr == NULL)
{
return MEMCACHED_INVALID_ARGUMENTS;
}
new_clone->poll_timeout= source->poll_timeout;
new_clone->connect_timeout= source->connect_timeout;
new_clone->retry_timeout= source->retry_timeout;
+ new_clone->dead_timeout= source->dead_timeout;
new_clone->distribution= source->distribution;
if (hashkit_clone(&new_clone->hashkit, &source->hashkit) == NULL)
new_clone->_namespace= memcached_array_clone(new_clone, source->_namespace);
new_clone->configure.filename= memcached_array_clone(new_clone, source->_namespace);
+ new_clone->configure.version= source->configure.version;
if (LIBMEMCACHED_WITH_SASL_SUPPORT and source->sasl.callbacks)
{