+ return MEMCACHED_INVALID_ARGUMENTS;
+}
+
+memcached_return_t memcached_instance_push(memcached_st *ptr, const struct memcached_instance_st* list, uint32_t number_of_hosts)
+{
+ if (list == NULL)
+ {
+ return MEMCACHED_SUCCESS;
+ }
+
+ uint32_t original_host_size= memcached_server_count(ptr);
+ uint32_t host_list_size= number_of_hosts +original_host_size;
+ memcached_instance_st* new_host_list= libmemcached_xrealloc(ptr, memcached_instance_list(ptr), host_list_size, memcached_instance_st);
+
+ if (new_host_list == NULL)
+ {
+ return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
+ }
+
+ memcached_instance_set(ptr, new_host_list, host_list_size);
+
+ // We don't bother with lookups for this operation
+ ptr->state.is_parsing= true;
+
+ // We use original_host_size since size will now point to the first new
+ // instance allocated.
+ for (uint32_t x= 0; x < number_of_hosts; ++x, ++original_host_size)
+ {
+ WATCHPOINT_ASSERT(list[x]._hostname[0] != 0);