1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

don't time out clients based on downstream traffic

This commit is contained in:
Jeff Becker 2019-08-05 08:18:37 -04:00
parent 768c6f7367
commit b6987a389c
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05

View file

@ -209,9 +209,13 @@ namespace llarp
return now - lastActive > 5000;
if(state == eSessionReady)
{
if(now <= lastSend)
// don't time out the connection if backlogged in downstream direction
// for clients dangling off the side of the network
const auto timestamp =
remoteRC.IsPublicRouter() ? lastSend : lastActive;
if(now <= timestamp)
return false;
return now - lastSend > 30000;
return now - timestamp > 30000;
}
if(state == eLinkEstablished)
return now - lastActive
@ -436,7 +440,10 @@ namespace llarp
Session::EnterState(State st)
{
state = st;
Alive();
if(st != eClose)
{
Alive();
}
if(st == eSessionReady)
{
parent->MapAddr(remoteRC.pubkey.as_array(), this);