send a bitset have all, if a local file is added

and minor fixes
This commit is contained in:
Green Sky
2026-01-08 18:36:27 +01:00
parent 254fe9c6d5
commit 866d64c7d8
4 changed files with 15 additions and 8 deletions

View File

@@ -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};

View File

@@ -11,7 +11,6 @@
#include <entt/container/dense_map.hpp>
#include "./ft1_sha1_info.hpp"
#include "./hash_utils.hpp"
#include <vector>
#include <deque>

View File

@@ -3,7 +3,7 @@
#include "./contact_components.hpp"
#include "./chunk_picker.hpp"
#include <iostream>
//#include <iostream>
bool addParticipation(ContactHandle4 c, ObjectHandle o) {
bool was_new {false};

View File

@@ -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<Components::SuspectedParticipants>()) {
for (const auto& pcv : o.get<Components::SuspectedParticipants>().participants) {
ContactHandle4 pch = _cs.contactHandle(pcv);
assert(static_cast<bool>(pch));
pch.emplace_or_replace<ChunkPickerUpdateTag>();
for (const auto cv : o.get<Components::SuspectedParticipants>().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<Components::SuspectedParticipants>()) {
// for (const auto& pcv : o.get<Components::SuspectedParticipants>().participants) {
// ContactHandle4 pch = _cs.contactHandle(pcv);
// assert(static_cast<bool>(pch));
// pch.emplace_or_replace<ChunkPickerUpdateTag>();
// }
//}
// in both cases, private and public, c (contact to) is the target
o.get_or_emplace<Components::AnnounceTargets>().targets.emplace(c);