All behavior changes should not require a flush.
[m6w6/libmemcached] / lib / memcached_auto.c
index 4af85e97bd385d56951aed7b192022482f23119b..0d0fc91797141d32a50b934613a921d970773a7a 100644 (file)
@@ -17,6 +17,9 @@ static memcached_return memcached_auto(memcached_st *ptr,
   if (ptr->hosts == NULL || ptr->number_of_hosts == 0)
     return MEMCACHED_NO_SERVERS;
 
+  if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test(&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
+    return MEMCACHED_BAD_KEY_PROVIDED;
+
   server_key= memcached_generate_hash(ptr, key, key_length);
 
   send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,