X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached.c;h=b0333569ec7fe8f45fe943a16d210b8d70eb502c;hb=10f3d6bf1bc11c235779ae735f30758cfb035686;hp=5ffaee9e34ba0f243289e29bd7d32b08bebd0db6;hpb=c52c930e6cb28a0c48c63992135691111fd9f779;p=awesomized%2Flibmemcached diff --git a/libmemcached/memcached.c b/libmemcached/memcached.c index 5ffaee9e..b0333569 100644 --- a/libmemcached/memcached.c +++ b/libmemcached/memcached.c @@ -34,7 +34,9 @@ static const memcached_st global_copy= { .use_sort_hosts= false, .use_udp= false, .verify_key= false, - .tcp_keepalive= false + .tcp_keepalive= false, + .load_from_file= false + } }; @@ -69,7 +71,7 @@ static inline bool _memcached_init(memcached_st *self) self->io_key_prefetch= 0; self->cached_errno= 0; self->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT; - self->connect_timeout= MEMCACHED_DEFAULT_TIMEOUT; + self->connect_timeout= MEMCACHED_DEFAULT_CONNECT_TIMEOUT; self->retry_timeout= 0; self->continuum_count= 0; @@ -92,10 +94,8 @@ static inline bool _memcached_init(memcached_st *self) self->get_key_failure= NULL; self->delete_trigger= NULL; self->callbacks= NULL; -#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT self->sasl.callbacks= NULL; self->sasl.is_allocated= false; -#endif return true; } @@ -154,6 +154,15 @@ void memcached_servers_reset(memcached_st *ptr) ptr->server_failure_limit= 0; } +void memcached_reset_last_disconnected_server(memcached_st *ptr) +{ + if (ptr->last_disconnected_server) + { + memcached_server_free(ptr->last_disconnected_server); + ptr->last_disconnected_server= NULL; + } +} + void memcached_free(memcached_st *ptr) { /* If we have anything open, lets close it now */ @@ -170,12 +179,12 @@ void memcached_free(memcached_st *ptr) if (ptr->continuum) libmemcached_free(ptr, ptr->continuum); -#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT - if (ptr->sasl.callbacks != NULL) + if (ptr->sasl.callbacks) { +#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT memcached_destroy_sasl_auth_data(ptr); - } #endif + } if (memcached_is_allocated(ptr)) {