MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / Retrieve

Method Retrieve

libcppcryptfs/util/KeyCache.cpp:234–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234bool KeyCache::Retrieve(id_t id, const vector<KeyBuf>& kbv)
235{
236 lock_guard<mutex> lock(m_mutex);
237
238 if (!m_enabled)
239 return false;
240
241 auto it = m_entries.find(id);
242
243 assert(it != m_entries.end());
244
245 if (it == m_entries.end())
246 return false;
247
248 if (!it->second.valid)
249 return false;
250
251 KeyBuf::CopyBuffers(kbv, it->second.pbuf->m_buf, it->second.pbuf->m_len);
252
253 it->second.accessed = true;
254
255 return true;
256}

Callers 1

EnterInternalMethod · 0.80

Calls 1

findMethod · 0.80

Tested by

no test coverage detected