if (ptr->hosts == NULL || ptr->number_of_hosts == 0)
return MEMCACHED_NO_SERVERS;
- if (key_test(&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)
+ 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);