Added MD5 hashing scheme. Refactored code to allow for more hashing types.
[m6w6/libmemcached] / lib / memcached_verbosity.c
index ecea6f225c16d6c88f228c4172d819efcbf4bd19..5d308aa2380399ff0da0e15553e3604fa37d8af7 100644 (file)
@@ -1,9 +1,9 @@
-#include <memcached.h>
+#include "common.h"
 
 memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbosity)
 {
   unsigned int x;
-  size_t send_length, sent_length;
+  size_t send_length;
   memcached_return rc;
   char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
 
@@ -21,10 +21,11 @@ memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbosity)
   {
     memcached_return rc;
 
-    if ((sent_length= write(ptr->hosts[x].fd, buffer, send_length) == -1))
-      return MEMCACHED_WRITE_FAILURE;
-    if (sent_length != send_length)
-      return MEMCACHED_WRITE_FAILURE;
+    if ((memcached_io_write(ptr, x, buffer, send_length, 1)) == -1)
+    {
+      continue;
+      return MEMCACHED_SOME_ERRORS;
+    }
 
     rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, x);