Small cleanup in string.h and converted result_st macro to inline.
[awesomized/libmemcached] / libmemcached / quit.c
index dc11e97fcea5e65356c5775ca5147d2a01b733ad..c22635a8a77af69ff22d2def8a810d461b6d8198 100644 (file)
@@ -69,15 +69,19 @@ void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death)
 
 void memcached_quit(memcached_st *ptr)
 {
-  unsigned int x;
+  uint32_t x;
 
-  if (ptr->hosts == NULL ||
-      ptr->number_of_hosts == 0)
+  if (memcached_server_count(ptr) == 0)
     return;
 
-  if (ptr->hosts && ptr->number_of_hosts)
+  if (memcached_server_count(ptr))
   {
-    for (x= 0; x < ptr->number_of_hosts; x++)
-      memcached_quit_server(&ptr->hosts[x], 0);
+    for (x= 0; x < memcached_server_count(ptr); x++)
+    {
+      memcached_server_instance_st *instance=
+        memcached_server_instance_fetch(ptr, x);
+
+      memcached_quit_server(instance, 0);
+    }
   }
 }