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:
parent
768c6f7367
commit
b6987a389c
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue