MEMCACHED_SERVER_STATE_ADDRINFO, // ADDRRESS information has been gathered
MEMCACHED_SERVER_STATE_IN_PROGRESS,
MEMCACHED_SERVER_STATE_CONNECTED,
- MEMCACHED_SERVER_STATE_IN_TIMEOUT
+ MEMCACHED_SERVER_STATE_IN_TIMEOUT,
+ MEMCACHED_SERVER_STATE_DISABLED
};
struct memcached_server_st {
memcached_return_t run_distribution(memcached_st *ptr);
-#define memcached_server_response_increment(A) (A)->cursor_active++
-#define memcached_server_response_decrement(A) (A)->cursor_active--
-#define memcached_server_response_reset(A) (A)->cursor_active=0
+#define memcached_server_response_increment(A) (A)->cursor_active_++
+#define memcached_server_response_decrement(A) (A)->cursor_active_--
+#define memcached_server_response_reset(A) (A)->cursor_active_=0
-#define memcached_instance_response_increment(A) (A)->cursor_active++
-#define memcached_instance_response_decrement(A) (A)->cursor_active--
-#define memcached_instance_response_reset(A) (A)->cursor_active=0
+#define memcached_instance_response_increment(A) (A)->cursor_active_++
+#define memcached_instance_response_decrement(A) (A)->cursor_active_--
+#define memcached_instance_response_reset(A) (A)->cursor_active_=0
#ifdef __cplusplus
}
bool timeout_error_occured= false;
WATCHPOINT_ASSERT(server->fd == INVALID_SOCKET);
- WATCHPOINT_ASSERT(server->cursor_active == 0);
+ WATCHPOINT_ASSERT(server->cursor_active_ == 0);
/*
We want to check both of these because if address_info_next has been fully tried, we want to do a new lookup to make sure we have picked up on any new DNS information.
failures_occured_in_sending= true;
continue;
}
- WATCHPOINT_ASSERT(instance->cursor_active == 0);
+ WATCHPOINT_ASSERT(instance->cursor_active_ == 0);
memcached_instance_response_increment(instance);
- WATCHPOINT_ASSERT(instance->cursor_active == 1);
+ WATCHPOINT_ASSERT(instance->cursor_active_ == 1);
}
else
{
self->options.is_shutting_down= false;
self->options.is_dead= false;
self->number_of_hosts= 0;
- self->cursor_active= 0;
+ self->cursor_active_= 0;
self->port_= port;
self->fd= INVALID_SOCKET;
self->io_bytes_sent= 0;
return 0;
}
- return self->cursor_active;
+ return self->cursor_active_;
}
port_= arg;
}
- inline void mark_server_as_clean()
+ void mark_server_as_clean()
{
server_failure_counter= 0;
next_retry= 0;
}
+ void disable()
+ {
+ }
+
+ void enable()
+ {
+ }
+
+ uint32_t response_count() const
+ {
+ return cursor_active_;
+ }
+
struct {
bool is_allocated:1;
bool is_initialized:1;
bool is_dead:1;
} options;
uint32_t number_of_hosts;
- uint32_t cursor_active;
+ uint32_t cursor_active_;
in_port_t port_;
memcached_socket_t fd;
uint32_t io_bytes_sent; /* # bytes sent since last read */
}
ptr->state= MEMCACHED_SERVER_STATE_NEW;
- ptr->cursor_active= 0;
+ ptr->cursor_active_= 0;
ptr->io_bytes_sent= 0;
ptr->write_buffer_offset= size_t(ptr->root and memcached_is_udp(ptr->root) ? UDP_DATAGRAM_HEADER_LENGTH : 0);
ptr->read_buffer_length= 0;
return 0;
}
- return self->cursor_active;
+ return self->cursor_active_;
}
const char *memcached_server_type(const memcached_server_instance_st ptr)
* memcached_response will decrement the counter, so I need to reset it..
* todo: look at this and try to find a better solution.
* */
- instance->cursor_active= 0;
+ instance->cursor_active_= 0;
return MEMCACHED_SUCCESS;
}