X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fquit.cc;h=ffd4cd459cd767e71537e4e0971546f7fe53d70e;hb=22703aea253937edbd20139658705722b4d094ed;hp=fa7599ede2a0f5d4b15e858930ed65531f9444de;hpb=28adf7b936c6f5c25b7526ff56ec1256da1246d4;p=m6w6%2Flibmemcached diff --git a/libmemcached/quit.cc b/libmemcached/quit.cc index fa7599ed..ffd4cd45 100644 --- a/libmemcached/quit.cc +++ b/libmemcached/quit.cc @@ -50,7 +50,7 @@ void memcached_quit_server(memcached_server_st *ptr, bool io_death) { if (ptr->fd != INVALID_SOCKET) { - if (io_death == false && ptr->type != MEMCACHED_CONNECTION_UDP && ptr->options.is_shutting_down == false) + if (io_death == false and memcached_is_udp(ptr->root) == false and ptr->options.is_shutting_down == false) { ptr->options.is_shutting_down= true; @@ -100,7 +100,7 @@ void memcached_quit_server(memcached_server_st *ptr, bool io_death) ptr->state= MEMCACHED_SERVER_STATE_NEW; ptr->cursor_active= 0; ptr->io_bytes_sent= 0; - ptr->write_buffer_offset= (size_t) ((ptr->type == MEMCACHED_CONNECTION_UDP) ? UDP_DATAGRAM_HEADER_LENGTH : 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; ptr->read_ptr= ptr->read_buffer; ptr->options.is_shutting_down= false; @@ -112,8 +112,7 @@ void memcached_quit_server(memcached_server_st *ptr, bool io_death) if (io_death) { - ptr->server_failure_counter++; - set_last_disconnected_host(ptr); + memcached_mark_server_for_timeout(ptr); } }