memcached_quit should clear internal server variables
authorTrond Norbye <tn202803@atum03>
Fri, 18 Dec 2009 11:17:36 +0000 (12:17 +0100)
committerTrond Norbye <tn202803@atum03>
Fri, 18 Dec 2009 11:17:36 +0000 (12:17 +0100)
libmemcached/quit.c

index 4abadb94c60bbaa2afe84705232353c5a0a58f9f..dc11e97fcea5e65356c5775ca5147d2a01b733ad 100644 (file)
@@ -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)