* Solaris 64bit fix.
* Support for weighted Ketama from Yin Chen.
* Fix for Chinese
+ * Fix for 0 length key to trigger bad key.
0.22 Mon Jul 14 09:24:11 PDT 2008
* Fix where master key was no being checked for "bad key"
for (x= 0; x < number_of_keys; x++)
{
int y;
+
+ if (*(key_length + x) == 0)
+ return MEMCACHED_BAD_KEY_PROVIDED;
+
for (y= 0; y < *(key_length + x); y++)
{
if ((isgraph(keys[x][y])) == 0)
assert(rc == MEMCACHED_BAD_KEY_PROVIDED);
}
+ /* Make sure zero length keys are marked as bad */
+ set= 1;
+ rc= memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
+ assert(rc == MEMCACHED_SUCCESS);
+ string= memcached_get(clone, key, 0,
+ &string_length, &flags, &rc);
+ assert(rc == MEMCACHED_BAD_KEY_PROVIDED);
+ assert(string_length == 0);
+ assert(!string);
+
memcached_free(clone);
return 0;