From 866d64c7d8b4db52dd5943d79766d57b262aee5f Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 8 Jan 2026 18:36:27 +0100 Subject: [PATCH] send a bitset have all, if a local file is added and minor fixes --- .../backends/sha1_mapped_filesystem.cpp | 2 +- solanaceae/ngc_ft1_sha1/components.hpp | 1 - solanaceae/ngc_ft1_sha1/participation.cpp | 2 +- solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp | 18 +++++++++++++----- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/solanaceae/ngc_ft1_sha1/backends/sha1_mapped_filesystem.cpp b/solanaceae/ngc_ft1_sha1/backends/sha1_mapped_filesystem.cpp index ec76b43..626a32e 100644 --- a/solanaceae/ngc_ft1_sha1/backends/sha1_mapped_filesystem.cpp +++ b/solanaceae/ngc_ft1_sha1/backends/sha1_mapped_filesystem.cpp @@ -89,7 +89,7 @@ void SHA1MappedFilesystem::newFromFile(std::string_view file_name, std::string_v sha1_info.file_size = file_impl->_file_size; // TODO: remove the reliance on implementation details sha1_info.chunk_size = chunkSizeFromFileSize(sha1_info.file_size); { - // TOOD: remove + // TODO: remove const uint32_t cs_low {32*1024}; const uint32_t cs_high {4*1024*1024}; diff --git a/solanaceae/ngc_ft1_sha1/components.hpp b/solanaceae/ngc_ft1_sha1/components.hpp index f51f5ec..323a4d6 100644 --- a/solanaceae/ngc_ft1_sha1/components.hpp +++ b/solanaceae/ngc_ft1_sha1/components.hpp @@ -11,7 +11,6 @@ #include #include "./ft1_sha1_info.hpp" -#include "./hash_utils.hpp" #include #include diff --git a/solanaceae/ngc_ft1_sha1/participation.cpp b/solanaceae/ngc_ft1_sha1/participation.cpp index 35dae66..bb7fbeb 100644 --- a/solanaceae/ngc_ft1_sha1/participation.cpp +++ b/solanaceae/ngc_ft1_sha1/participation.cpp @@ -3,7 +3,7 @@ #include "./contact_components.hpp" #include "./chunk_picker.hpp" -#include +//#include bool addParticipation(ContactHandle4 c, ObjectHandle o) { bool was_new {false}; diff --git a/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp b/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp index 6fcc3a4..be1037c 100644 --- a/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp +++ b/solanaceae/ngc_ft1_sha1/sha1_ngcft1.cpp @@ -517,15 +517,23 @@ void SHA1_NGCFT1::onSendFileHashFinished(ObjectHandle o, Message3Registry* reg_p // TODO: we dont want chunks anymore // TODO: make sure to abort every receiving transfer (sending info and chunk should be fine, info uses copy and chunk handle) - // something happend, update all chunk pickers + // queue a send bitset (have all) to all participants if (o.all_of()) { - for (const auto& pcv : o.get().participants) { - ContactHandle4 pch = _cs.contactHandle(pcv); - assert(static_cast(pch)); - pch.emplace_or_replace(); + for (const auto cv : o.get().participants) { + queueBitsetSendFull(_cs.contactHandle(cv), o); } } + // something happend, update all chunk pickers + // wtf why, we now have the full file, no? why update the receiving + //if (o.all_of()) { + // for (const auto& pcv : o.get().participants) { + // ContactHandle4 pch = _cs.contactHandle(pcv); + // assert(static_cast(pch)); + // pch.emplace_or_replace(); + // } + //} + // in both cases, private and public, c (contact to) is the target o.get_or_emplace().targets.emplace(c);