From: Brian Aker Date: Mon, 4 Apr 2011 20:46:23 +0000 (-0700) Subject: Remove dead bit in state for servers. X-Git-Tag: 0.51~15^2~47 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=32837dc24fd35afdc5855b3a7540270991b17611;p=m6w6%2Flibmemcached Remove dead bit in state for servers. --- diff --git a/libmemcached/server.c b/libmemcached/server.c index ea44092c..b446d131 100644 --- a/libmemcached/server.c +++ b/libmemcached/server.c @@ -19,6 +19,7 @@ static inline void _server_init(memcached_server_st *self, const memcached_st *r uint32_t weight, memcached_connection_t type) { self->options.is_shutting_down= false; + self->options.is_dead= false; self->number_of_hosts= 0; self->cursor_active= 0; self->port= port; @@ -27,8 +28,6 @@ static inline void _server_init(memcached_server_st *self, const memcached_st *r self->io_bytes_sent= 0; self->server_failure_counter= 0; self->weight= weight ? weight : 1; // 1 is the default weight value - self->state.is_corked= false; - self->state.is_dead= false; WATCHPOINT_SET(self->io_wait_count.read= 0); WATCHPOINT_SET(self->io_wait_count.write= 0); self->major_version= UINT8_MAX; diff --git a/libmemcached/server.h b/libmemcached/server.h index 136fa8a8..fd731e0e 100644 --- a/libmemcached/server.h +++ b/libmemcached/server.h @@ -18,6 +18,7 @@ struct memcached_server_st { bool is_allocated:1; bool is_initialized:1; bool is_shutting_down:1; + bool is_dead:1; } options; uint32_t number_of_hosts; uint32_t cursor_active; @@ -27,10 +28,6 @@ struct memcached_server_st { uint32_t io_bytes_sent; /* # bytes sent since last read */ uint32_t server_failure_counter; uint32_t weight; - struct { // Place any "state" sort variables in here. - bool is_corked:1; - bool is_dead:1; - } state; struct { uint32_t read; uint32_t write; diff --git a/tests/mem_functions.c b/tests/mem_functions.c index 96d0ac20..600ffb8f 100644 --- a/tests/mem_functions.c +++ b/tests/mem_functions.c @@ -5471,7 +5471,7 @@ static test_return_t test_cull_servers(memcached_st *memc) uint32_t count = memcached_server_count(memc); // Do not do this in your code, it is not supported. - memc->servers[1].state.is_dead= true; + memc->servers[1].options.is_dead= true; memc->state.is_time_for_rebuild= true; uint32_t new_count= memcached_server_count(memc);