receiving files works. taking into account that chunks can excist multiple times

This commit is contained in:
2023-08-19 00:15:09 +02:00
parent 04875e999f
commit 211cce65de
2 changed files with 94 additions and 44 deletions

View File

@ -37,6 +37,7 @@ class SHA1_NGCFT1 : public RegistryMessageModelEventI, public NGCFT1EventI {
// sha1 chunk index
// TODO: optimize lookup
// TODO: multiple contents. hashes might be unique, but data is not
entt::dense_map<SHA1Digest, ContentHandle> _chunks;
// group_number, peer_number, content, chunk_hash, timer
@ -76,8 +77,7 @@ class SHA1_NGCFT1 : public RegistryMessageModelEventI, public NGCFT1EventI {
struct Chunk {
ContentHandle content;
size_t chunk_index;
//uint64_t offset_into_file;
std::vector<size_t> chunk_indices;
// or data?
// if memmapped, this would be just a pointer
};