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

Merge pull request #455 from majestrate/master

staging
This commit is contained in:
Jeff 2019-03-27 17:14:17 -04:00 committed by GitHub
commit 80e8c4006b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 15 deletions

View file

@ -611,9 +611,7 @@ namespace llarp
return false;
buf.sz = buf.cur - buf.base;
buf.cur = buf.base;
if(!this->QueueWriteBuffers(buf))
return false;
PumpWrite();
return this->QueueWriteBuffers(buf);
}
return true;
};
@ -765,6 +763,9 @@ namespace llarp
{
if(sendq.size() >= MaxSendQueueSize)
return false;
// premptive pump
if(sendq.size() >= MaxSendQueueSize / 2)
PumpWrite();
size_t sz = buf.sz;
byte_t* ptr = buf.base;
uint32_t msgid = m_NextTXMsgID++;

View file

@ -575,18 +575,10 @@ namespace llarp
return;
}
}
if(m_LastRecvMessage && now > m_LastRecvMessage
&& now - m_LastRecvMessage > PATH_ALIVE_TIMEOUT)
if(m_LastRecvMessage && now > m_LastRecvMessage)
{
if(m_CheckForDead)
{
if(m_CheckForDead(this, dlt))
{
r->routerProfiling().MarkPathFail(this);
EnterState(ePathTimeout, now);
}
}
else
auto dlt = now - m_LastRecvMessage;
if(m_CheckForDead && m_CheckForDead(this, dlt))
{
r->routerProfiling().MarkPathFail(this);
EnterState(ePathTimeout, now);

View file

@ -1057,8 +1057,11 @@ namespace llarp
}
bool
Endpoint::CheckPathIsDead(path::Path*, llarp_time_t)
Endpoint::CheckPathIsDead(path::Path*, llarp_time_t dlt)
{
if(dlt <= 30000)
return false;
RouterLogic()->call_later(
{100, this, [](void* u, uint64_t, uint64_t left) {
if(left)