}
if (master_key && master_key_length)
+ {
+ if ((ptr->flags & MEM_VERIFY_KEY) && (memcachd_key_test((char **)&master_key, &master_key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
+ return MEMCACHED_BAD_KEY_PROVIDED;
master_server_key= memcached_generate_hash(ptr, master_key, master_key_length);
+ }
/*
Here is where we pay for the non-block API. We need to remove any data sitting
clone= memcached_clone(NULL, memc);
assert(clone);
- (void)memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
+ rc= memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
+ assert(rc == MEMCACHED_SUCCESS);
string= memcached_get(clone, key, strlen(key),
&string_length, &flags, &rc);
assert(!string);
set= 0;
- (void)memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
+ rc= memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
+ assert(rc == MEMCACHED_SUCCESS);
string= memcached_get(clone, key, strlen(key),
&string_length, &flags, &rc);
assert(rc == MEMCACHED_NOTFOUND);
assert(string_length == 0);
assert(!string);
+ /* Test multi key for bad keys */
+ {
+ char *keys[] = { "GoodKey", "Bad Key", "NotMine" };
+ size_t key_lengths[] = { 7, 7, 7 };
+ set= 1;
+ rc= memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ rc= memcached_mget(clone, keys, &key_lengths, 3);
+ assert(rc == MEMCACHED_BAD_KEY_PROVIDED);
+
+ rc= memcached_mget_by_key(clone, "foo daddy", 9, keys, &key_lengths, 1);
+ assert(rc == MEMCACHED_BAD_KEY_PROVIDED);
+ }
+
memcached_free(clone);
return 0;