try expiring convos

pull/300/head
Jeff Becker 5 years ago
parent 6df133cab2
commit 9a2f11a212
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -366,6 +366,17 @@ namespace llarp
++itr;
}
}
// expire convotags
{
auto itr = m_Sessions.begin();
while(itr != m_Sessions.end())
{
if(itr->second.IsExpired(now))
itr = m_Sessions.erase(itr);
else
++itr;
}
}
}
bool
@ -394,7 +405,8 @@ namespace llarp
bool
Endpoint::OutboundContext::IsDone(llarp_time_t now) const
{
return now - lastGoodSend > (DEFAULT_PATH_LIFETIME / 4) && ShouldRemove();
(void)now;
return AvailablePaths(path::ePathRoleAny) == 0 && ShouldRemove();
}
uint64_t

@ -553,6 +553,14 @@ namespace llarp
intro.ExtractStatus(introObj);
obj.PutObject("intro", introObj);
};
bool
IsExpired(llarp_time_t now) const
{
if(now <= lastUsed)
return false;
return intro.IsExpired(now);
}
};
/// sessions

Loading…
Cancel
Save