+ if (memcached_is_encrypted(instance->root) and memcached_result_length(result))
+ {
+ hashkit_string_st *destination;
+
+ if ((destination= hashkit_decrypt(&instance->root->hashkit,
+ memcached_result_value(result), memcached_result_length(result))) == NULL)
+ {
+ rc= memcached_set_error(*instance->root, MEMCACHED_FAILURE,
+ MEMCACHED_AT, memcached_literal_param("hashkit_decrypt() failed"));
+ }
+ else
+ {
+ memcached_result_reset_value(result);
+ if (memcached_failed(memcached_result_set_value(result, hashkit_string_c_str(destination), hashkit_string_length(destination))))
+ {
+ rc= memcached_set_error(*instance->root, MEMCACHED_FAILURE,
+ MEMCACHED_AT, memcached_literal_param("hashkit_decrypt() failed"));
+ }
+ }
+
+ if (memcached_failed(rc))
+ {
+ memcached_result_reset(result);
+ }
+ hashkit_string_free(destination);
+ }
+
+ return rc;