fix front access to empty array

and increase send timeout assert
This commit is contained in:
2024-07-15 11:48:16 +02:00
parent 10756e13ce
commit 489556e322
2 changed files with 53 additions and 48 deletions

View File

@@ -8,9 +8,10 @@ void SendingTransfers::tick(float delta) {
for (auto it = peer_it->second.begin(); it != peer_it->second.end();) {
it->second.time_since_activity += delta;
// if we have not heard for 2min, timeout (lower level event on real timeout)
// if we have not heard for 10min, timeout (lower level event on real timeout)
// (2min was too little, so it seems)
// TODO: do we really need this if we get events?
if (it->second.time_since_activity >= 120.f) {
if (it->second.time_since_activity >= 60.f*10.f) {
std::cerr << "SHA1_NGCFT1 warning: sending tansfer timed out " << "." << int(it->first) << "\n";
assert(false);
it = peer_it->second.erase(it);