kill fully backlogged sessions

This commit is contained in:
Jeff Becker 2019-03-29 11:26:44 -04:00
parent 5af8d0a392
commit 89477b3523
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -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;