+void memcached_server_list_free(memcached_server_st *self)
+{
+ server_list_free(NULL, self);
+}
+
+/**
+ @todo allow lists to query themselves even if they lack a root
+*/
+memcached_return_t memcached_server_remove(memcached_server_st *self)
+{
+ uint32_t host_index= 0;
+ memcached_st *root= (memcached_st *)self->root;
+ memcached_server_st *list;
+
+ if (root == NULL)
+ return MEMCACHED_FAILURE;
+
+ list= memcached_server_list(root);
+
+ /* Until we devise a way to mark servers that are about to be harvested, we need to shutdown before doing the clone. */
+ memcached_quit(root);
+
+ for (uint32_t x= 0; x < memcached_server_count(root); x++)
+ {
+ if (strncmp(list[x].hostname, self->hostname, NI_MAXHOST) != 0 || list[x].port != self->port)
+ {
+ if (host_index != x)
+ {
+ memcached_server_st *check=
+ memcached_server_clone(list+host_index, list+x);
+
+ if (! check) // Now we are in trouble, allocation didn't happen and we are midway through an operation. Bail!
+ {
+ return MEMCACHED_FAILURE;
+ }
+ memcached_server_free(list+x);
+ }
+ host_index++;
+ }
+ }
+ root->number_of_hosts= host_index;
+
+ run_distribution(root);
+
+ return MEMCACHED_SUCCESS;
+}
+
+
+inline uint32_t memcached_servers_set_count(memcached_server_st *servers, uint32_t count)