38 ccf::indexing::LFSMsg::store,
39 [&](
const uint8_t* data,
size_t size) {
40 auto [key, encrypted] =
41 ringbuffer::read_message<ccf::indexing::LFSMsg::store>(data, size);
43 const auto target_path =
root_dir / key;
44 std::ofstream f(target_path, std::ios::trunc | std::ios::binary);
46 "Writing {} byte file to {}", encrypted.size(), target_path);
47 f.write((
char const*)encrypted.data(), encrypted.size());
53 ccf::indexing::LFSMsg::get,
54 [&](
const uint8_t* data,
size_t size) {
56 ringbuffer::read_message<ccf::indexing::LFSMsg::get>(data, size);
58 const auto target_path =
root_dir / key;
59 if (std::filesystem::is_regular_file(target_path))
61 std::ifstream f(target_path, std::ios::binary);
63 const auto file_size = f.tellg();
65 "Reading {} byte file from {}",
66 static_cast<size_t>(file_size),
71 f.read((
char*)blob.data(), blob.size());
74 ccf::indexing::LFSMsg::response,
writer, key, blob);
80 ccf::indexing::LFSMsg::not_found,
writer, key);