mark loopback convotags as forever

make null handler mark discard data as activity for convotag
pull/1576/head
Jeff Becker 3 years ago
parent f310778f81
commit 309a899c9f
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -48,8 +48,10 @@ namespace llarp
uint64_t seqno) override
{
if (t == service::ProtocolType::Control)
{
MarkConvoTagActive(tag);
return true;
}
if (t != service::ProtocolType::QUIC)
return false;

@ -1536,9 +1536,9 @@ namespace llarp
tag = *maybe;
else
tag.Randomize();
PutSenderFor(tag, m_Identity.pub, true);
MarkConvoTagActive(tag);
Sessions()[tag].forever = true;
Loop()->call_soon([tag, hook]() { hook(tag); });
return true;
}

@ -19,6 +19,8 @@ namespace llarp
bool
Session::IsExpired(llarp_time_t now, llarp_time_t lifetime) const
{
if (forever)
return false;
return now > lastUsed && (now - lastUsed > lifetime || intro.IsExpired(now));
}

@ -26,6 +26,7 @@ namespace llarp
llarp_time_t lastUsed = 0s;
uint64_t seqno = 0;
bool inbound = false;
bool forever = false;
util::StatusObject
ExtractStatus() const;

Loading…
Cancel
Save