Fix for flags operation (aka not storing the final bit right). Updated
[awesomized/libmemcached] / libmemcached / memcached_storage.c
index 8f04c528e24ca24e4c6bfcfc6a0d707802c30b50..04f281cc898417866159ed2af239a7f78eb43dd4 100644 (file)
@@ -36,6 +36,8 @@ static char *storage_op_string(memcached_storage_action verb)
     return "append";
   case CAS_OP:
     return "cas";
+  default:
+    return "tosserror"; /* This is impossible, fixes issue for compiler warning in VisualStudio */
   };
 
   return SET_OP;
@@ -72,13 +74,15 @@ static inline memcached_return memcached_send(memcached_st *ptr,
 
   if (cas)
     write_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
-                           "%s %.*s %u %llu %zu %llu\r\n", storage_op_string(verb),
+                           "%s %s%.*s %u %llu %zu %llu\r\n", storage_op_string(verb),
+                           ptr->prefix_key,
                            (int)key_length, key, flags, 
                            (unsigned long long)expiration, value_length, 
                            (unsigned long long)cas);
   else
     write_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
-                           "%s %.*s %u %llu %zu\r\n", storage_op_string(verb),
+                           "%s %s%.*s %u %llu %zu\r\n", storage_op_string(verb),
+                           ptr->prefix_key,
                            (int)key_length, key, flags, 
                            (unsigned long long)expiration, value_length);