make onLoss return if found

This commit is contained in:
Green Sky
2025-12-13 13:36:51 +01:00
parent 308790dc3a
commit 35a82cd67f
5 changed files with 16 additions and 8 deletions

View File

@@ -211,15 +211,18 @@ void FlowOnly::onAck(std::vector<SeqIDType> seqs) {
}
}
void FlowOnly::onLoss(SeqIDType seq, bool discard) {
bool FlowOnly::onLoss(SeqIDType seq, bool discard) {
auto it = std::find_if(_in_flight.begin(), _in_flight.end(), [seq](const auto& v) -> bool {
assert(!std::isnan(v.timestamp));
return v.id == seq;
});
// we care about it still being there, when we do not discard
if (it == _in_flight.end()) {
// error
return; // not found, ignore ??
if (!discard) {
std::cerr << "FLOW seq not found!\n";
}
return false; // not found, ignore ??
}
//std::cerr << "FLOW loss\n";
@@ -249,5 +252,7 @@ void FlowOnly::onLoss(SeqIDType seq, bool discard) {
// this is usually a safe indicator for congestion/maxed connection
onCongestion();
}
return true;
}