mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
kill fully backlogged sessions
This commit is contained in:
parent
5af8d0a392
commit
89477b3523
@ -87,6 +87,9 @@ namespace llarp
|
||||
ssize_t s = utp_writev(sock, vecs.data(), vecs.size());
|
||||
if(s < 0)
|
||||
return;
|
||||
if(s > 0)
|
||||
lastSend = parent->Now();
|
||||
|
||||
METRICS_DYNAMIC_INT_UPDATE(
|
||||
"utp.session.tx", RouterID(remoteRC.pubkey).ToString().c_str(), s);
|
||||
m_TXRate += s;
|
||||
@ -241,7 +244,7 @@ namespace llarp
|
||||
return false;
|
||||
if(sendq.size() >= MaxSendQueueSize)
|
||||
{
|
||||
return now - lastActive > 5000;
|
||||
return now - lastSend > 5000;
|
||||
}
|
||||
// let utp manage this
|
||||
return state == eClose;
|
||||
|
@ -109,6 +109,8 @@ namespace llarp
|
||||
SharedSecret txKey;
|
||||
/// timestamp last active
|
||||
llarp_time_t lastActive;
|
||||
/// timestamp last send success
|
||||
llarp_time_t lastSend;
|
||||
/// session timeout (60s)
|
||||
const static llarp_time_t sessionTimeout = DefaultLinkSessionLifetime;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user