Compare commits
2 Commits
151ddc38b2
...
1319c11daf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1319c11daf | ||
|
|
21d38a2a9d |
@@ -70,5 +70,8 @@ struct CCAI {
|
|||||||
|
|
||||||
// if discard, not resent, not inflight
|
// if discard, not resent, not inflight
|
||||||
virtual void onLoss(SeqIDType seq, bool discard) = 0;
|
virtual void onLoss(SeqIDType seq, bool discard) = 0;
|
||||||
|
|
||||||
|
// signal congestion externally (eg. send queue is full)
|
||||||
|
virtual void onCongestion(void) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ struct FlowOnly : public CCAI {
|
|||||||
|
|
||||||
void updateWindow(void);
|
void updateWindow(void);
|
||||||
|
|
||||||
virtual void onCongestion(void) {};
|
|
||||||
|
|
||||||
// internal logic, calls the onCongestion() event
|
// internal logic, calls the onCongestion() event
|
||||||
void updateCongestion(void);
|
void updateCongestion(void);
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
recv_activity = true; // count as activity, not sure we need this
|
||||||
} else {
|
} else {
|
||||||
transfer.timer += time_delta;
|
transfer.timer += time_delta;
|
||||||
if (transfer.timer < 0.5f) {
|
if (transfer.timer < 2.f) {
|
||||||
// back off when no activity
|
// back off when no activity
|
||||||
recv_activity = true;
|
recv_activity = true;
|
||||||
}
|
}
|
||||||
@@ -669,6 +669,7 @@ bool NGCFT1::onEvent(const Events::NGCEXT_ft1_data_ack& e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// delete if all packets acked
|
// delete if all packets acked
|
||||||
|
// TODO: check for FINISHING state?
|
||||||
if (transfer.file_size == transfer.file_size_current && transfer.ssb.size() == 0) {
|
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";
|
std::cout << "NGCFT1: " << int(e.transfer_id) << " done. wnd:" << peer.cca->getWindow() << "\n";
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -678,7 +679,6 @@ bool NGCFT1::onEvent(const Events::NGCEXT_ft1_data_ack& e) {
|
|||||||
e.transfer_id,
|
e.transfer_id,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// TODO: check for FINISHING state
|
|
||||||
peer.send_transfers[e.transfer_id].reset();
|
peer.send_transfers[e.transfer_id].reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user