From 04e768d414826cdea61b7b5f7e7e51b3c791feb5 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Fri, 18 Dec 2009 12:17:36 +0100 Subject: [PATCH] memcached_quit should clear internal server variables --- libmemcached/quit.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libmemcached/quit.c b/libmemcached/quit.c index 4abadb94..dc11e97f 100644 --- a/libmemcached/quit.c +++ b/libmemcached/quit.c @@ -53,15 +53,18 @@ void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death) ptr->server_failure_counter= 0; } memcached_io_close(ptr); - - ptr->fd= -1; - ptr->write_buffer_offset= (size_t) ((ptr->type == MEMCACHED_CONNECTION_UDP) ? UDP_DATAGRAM_HEADER_LENGTH : 0); - ptr->read_buffer_length= 0; - ptr->read_ptr= ptr->read_buffer; - memcached_server_response_reset(ptr); } - if(io_death) ptr->server_failure_counter++; + ptr->fd= -1; + ptr->write_buffer_offset= (size_t) ((ptr->type == MEMCACHED_CONNECTION_UDP) ? UDP_DATAGRAM_HEADER_LENGTH : 0); + ptr->read_buffer_length= 0; + ptr->read_ptr= ptr->read_buffer; + memcached_server_response_reset(ptr); + + if(io_death) + { + ptr->server_failure_counter++; + } } void memcached_quit(memcached_st *ptr) -- 2.30.2