Compare commits
3 Commits
3d4e286a7c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
866d64c7d8 | ||
|
|
254fe9c6d5 | ||
|
|
a647088218 |
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.18...3.24 FATAL_ERROR)
|
||||
|
||||
add_subdirectory(./external)
|
||||
|
||||
|
||||
2
external/CMakeLists.txt
vendored
2
external/CMakeLists.txt
vendored
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.18...3.24 FATAL_ERROR)
|
||||
|
||||
add_subdirectory(./sha1)
|
||||
|
||||
|
||||
2
external/sha1/CMakeLists.txt
vendored
2
external/sha1/CMakeLists.txt
vendored
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.18...3.24)
|
||||
|
||||
project(sha1 LANGUAGES C)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.9...3.24 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.18...3.24 FATAL_ERROR)
|
||||
|
||||
########################################
|
||||
|
||||
|
||||
@@ -168,13 +168,15 @@ void FlowOnly::onAck(std::vector<SeqIDType> seqs) {
|
||||
});
|
||||
if (it != _in_flight.end() && !it->ignore) {
|
||||
// find first non ignore, it should be the expected
|
||||
auto first_it = std::find_if_not(_in_flight.cbegin(), _in_flight.cend(), [](const auto& v) -> bool { return v.ignore; });
|
||||
auto first_it = std::find_if_not(_in_flight.begin(), _in_flight.end(), [](const auto& v) -> bool { return v.ignore; });
|
||||
|
||||
if (first_it != _in_flight.cend() && it != first_it && !it->ignore) {
|
||||
if (first_it != _in_flight.cend() && it != first_it && !first_it->ignore) {
|
||||
// not next expected seq -> skip detected
|
||||
|
||||
_consecutive_events++;
|
||||
it->ignore = true; // only handle once
|
||||
// only handle once
|
||||
it->ignore = true;
|
||||
first_it->ignore = true;
|
||||
|
||||
updateCongestion();
|
||||
} else {
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <entt/container/dense_map.hpp>
|
||||
|
||||
#include "./ft1_sha1_info.hpp"
|
||||
#include "./hash_utils.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user