small fixes

This commit is contained in:
Green Sky 2024-07-14 19:47:22 +02:00
parent 74414d0999
commit 10756e13ce
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -256,7 +256,7 @@ std::vector<ChunkPicker::ContentChunkR> ChunkPicker::updateChunkRequests(
// intersect self have with other have // intersect self have with other have
if (!o.all_of<Components::RemoteHave, Components::FT1ChunkSHA1Cache, Components::FT1InfoSHA1>()) { if (!o.all_of<Components::RemoteHave, Components::FT1ChunkSHA1Cache, Components::FT1InfoSHA1>()) {
// rare case where no one other has anything // rare case where no one else has anything
continue; continue;
} }
@ -309,7 +309,7 @@ std::vector<ChunkPicker::ContentChunkR> ChunkPicker::updateChunkRequests(
if (o.all_of<Components::ReadHeadHint>()) { if (o.all_of<Components::ReadHeadHint>()) {
const auto byte_offset = o.get<Components::ReadHeadHint>().offset_into_file; const auto byte_offset = o.get<Components::ReadHeadHint>().offset_into_file;
if (byte_offset <= info.file_size) { if (byte_offset <= info.file_size) {
start_offset = o.get<Components::ReadHeadHint>().offset_into_file/info.chunk_size; start_offset = byte_offset/info.chunk_size;
} else { } else {
// error? // error?
} }

View File

@ -38,7 +38,7 @@ void chunk_picker_updates(
//std::cout << "cput :)\n"; //std::cout << "cput :)\n";
if (!c.any_of<Contact::Components::ToxGroupPeerEphemeral, Contact::Components::FT1Participation>()) { if (!c.all_of<Contact::Components::ToxGroupPeerEphemeral, Contact::Components::FT1Participation>()) {
std::cout << "cput uh nuh :(\n"; std::cout << "cput uh nuh :(\n";
cp_to_remove.push_back(c); cp_to_remove.push_back(c);
return; return;