Fix for memcached_server_st after sort
author <brian@gir.tangent.org> <>
Fri, 4 Apr 2008 07:54:04 +0000 (00:54 -0700)
committer <brian@gir.tangent.org> <>
Fri, 4 Apr 2008 07:54:04 +0000 (00:54 -0700)
libmemcached/memcached_hosts.c

index 87a8cbd3058dfd3937122ee6cfefab234322616d..863e7674b7993a6a9dd2a5af13d6791e5014d690 100644 (file)
@@ -52,6 +52,7 @@ static int compare_servers(const void *p1, const void *p2)
 void sort_hosts(memcached_st *ptr)
 {
   qsort(ptr->hosts, ptr->number_of_hosts, sizeof(memcached_server_st), compare_servers);
+  ptr->hosts[0].count= ptr->number_of_hosts;
 }
 
 static void host_reset(memcached_st *ptr, memcached_server_st *host,