Fix for looping through multi-interfaces (in case one is busted)
[awesomized/libmemcached] / lib / memcached_flush.c
index 5fa5d960264ed02a54e4a83777104b5f612d759a..fa3dd8d8973eb9de56b925eea2177a973586aa7c 100644 (file)
@@ -20,10 +20,10 @@ memcached_return memcached_flush(memcached_st *ptr, time_t expiration)
       send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
                             "flush_all\r\n");
 
-    rc= memcached_do(ptr, x, buffer, send_length, 1);
+    rc= memcached_do(&ptr->hosts[x], buffer, send_length, 1);
 
     if (rc == MEMCACHED_SUCCESS)
-      (void)memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, x);
+      (void)memcached_response(&ptr->hosts[x], buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
   }
 
   LIBMEMCACHED_MEMCACHED_FLUSH_END();