From db1e9cf30a1ee8463150850313a6c4b6c9123282 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 28 Oct 2025 15:53:32 +0100 Subject: [PATCH] fix 2 implicit unsigned casts causing infinite window this effects finishing and resending --- solanaceae/ngc_ft1/ngcft1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solanaceae/ngc_ft1/ngcft1.cpp b/solanaceae/ngc_ft1/ngcft1.cpp index 7e348e7..620bcf6 100644 --- a/solanaceae/ngc_ft1/ngcft1.cpp +++ b/solanaceae/ngc_ft1/ngcft1.cpp @@ -49,7 +49,7 @@ void NGCFT1::updateSendTransfer(float time_delta, uint32_t group_number, uint32_ case State::FINISHING: // we still have unacked packets tf.ssb.for_each(time_delta, [&](uint16_t id, const std::vector& data, float& time_since_activity) { if (timeouts_set.count({idx, id})) { - if (can_packet_size >= data.size()) { + if (can_packet_size >= int64_t(data.size())) { _neep.send_ft1_data(group_number, peer_number, idx, id, data.data(), data.size()); peer.cca->onLoss({idx, id}, false); time_since_activity = 0.f; @@ -109,7 +109,7 @@ void NGCFT1::updateSendTransfer(float time_delta, uint32_t group_number, uint32_ // do resends tf.ssb.for_each(time_delta, [&](uint16_t id, const std::vector& data, float& time_since_activity) { - if (can_packet_size >= data.size() && time_since_activity >= peer.cca->getCurrentDelay() && timeouts_set.count({idx, id})) { + if (can_packet_size >= int64_t(data.size()) && time_since_activity >= peer.cca->getCurrentDelay() && timeouts_set.count({idx, id})) { // TODO: can fail _neep.send_ft1_data(group_number, peer_number, idx, id, data.data(), data.size()); peer.cca->onLoss({idx, id}, false);