- char *key= (char *)data;
-
- if (key)
- {
- size_t key_length= strlen(key);
-
- if (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED)
- return memcached_set_error(ptr, MEMCACHED_BAD_KEY_PROVIDED, NULL);
-
- if ((key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1))
- return memcached_set_error(ptr, MEMCACHED_KEY_TOO_BIG, NULL);
-
- memcached_array_free(ptr->prefix_key);
- ptr->prefix_key= memcached_strcpy(ptr, (const char *)data, strlen((const char*)data));
-
- if (! ptr->prefix_key)
- return memcached_set_error(ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, NULL);
- }
- else
- {
- memcached_array_free(ptr->prefix_key);
- ptr->prefix_key= NULL;
- }
-
- break;