2 Commits

Author SHA1 Message Date
Green Sky
1319c11daf fix receiving transfers sometimes failing to adjust tick interval 2025-12-12 14:57:48 +01:00
Green Sky
21d38a2a9d make onCongestion cca interface 2025-12-12 14:55:58 +01:00
3 changed files with 5 additions and 4 deletions

View File

@@ -70,5 +70,8 @@ struct CCAI {
// if discard, not resent, not inflight
virtual void onLoss(SeqIDType seq, bool discard) = 0;
// signal congestion externally (eg. send queue is full)
virtual void onCongestion(void) {};
};

View File

@@ -58,8 +58,6 @@ struct FlowOnly : public CCAI {
void updateWindow(void);
virtual void onCongestion(void) {};
// internal logic, calls the onCongestion() event
void updateCongestion(void);

View File

@@ -189,7 +189,7 @@ bool NGCFT1::iteratePeer(float time_delta, uint32_t group_number, uint32_t peer_
recv_activity = true; // count as activity, not sure we need this
} else {
transfer.timer += time_delta;
if (transfer.timer < 0.5f) {
if (transfer.timer < 2.f) {
// back off when no activity
recv_activity = true;
}
@@ -669,6 +669,7 @@ bool NGCFT1::onEvent(const Events::NGCEXT_ft1_data_ack& e) {
}
// delete if all packets acked
// TODO: check for FINISHING state?
if (transfer.file_size == transfer.file_size_current && transfer.ssb.size() == 0) {
std::cout << "NGCFT1: " << int(e.transfer_id) << " done. wnd:" << peer.cca->getWindow() << "\n";
dispatch(
@@ -678,7 +679,6 @@ bool NGCFT1::onEvent(const Events::NGCEXT_ft1_data_ack& e) {
e.transfer_id,
}
);
// TODO: check for FINISHING state
peer.send_transfers[e.transfer_id].reset();
}