return memcached_strerror(NULL, rc);
}
+ /**
+ * Fetches an individual value from the server.
+ *
+ * @param[in] key key of object to fetch
+ * @param[out] ret_val store returned object in this vector
+ * @return true on success; false on failure
+ */
bool fetch(std::string &key,
- std::vector<char> &ret_val,
- uint32_t *flags,
- memcached_return *rc)
+ std::vector<char> &ret_val)
{
char ret_key[MEMCACHED_MAX_KEY];
size_t value_length= 0;
size_t key_length= 0;
+ memcached_return rc;
+ uint32_t flags= 0;
char *value= memcached_fetch(&memc, ret_key, &key_length,
- &value_length, flags, rc);
+ &value_length, &flags, &rc);
if (value && ret_val.empty())
{
ret_val.reserve(value_length);
values.push_back(&val1);
values.push_back(&val2);
values.push_back(&val3);
- uint32_t flags;
string return_key;
vector<char> return_value;
rc= mc.mget(keys);
assert(rc == true);
- while (mc.fetch(return_key, return_value,
- &flags, &mc_rc))
+ while (mc.fetch(return_key, return_value))
{
assert(return_value.size() != 0);
return_value.clear();
rc= mc.mget(keys);
assert(rc == true);
- while ((mc.fetch(return_key, return_value,
- &flags, &mc_rc)))
+ while ((mc.fetch(return_key, return_value)))
{
- assert(mc_rc == MEMCACHED_SUCCESS);
assert(return_key.length() == return_value.size());
assert(!memcmp(&return_value[0], return_key.c_str(), return_value.size()));
}