From 071fce45292f67b6b8c215402a468a5397e19cd5 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 27 Mar 2019 13:24:17 -0400 Subject: [PATCH 1/3] premptive pumpwrite --- llarp/link/utp.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llarp/link/utp.cpp b/llarp/link/utp.cpp index 3ff337c63..60f4bf8af 100644 --- a/llarp/link/utp.cpp +++ b/llarp/link/utp.cpp @@ -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++; From fcdef8d3639f73deb87d17bc4f03b0ea645ea306 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 27 Mar 2019 16:25:54 -0400 Subject: [PATCH 2/3] don't mark paths as dead after established --- llarp/path/path.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/llarp/path/path.cpp b/llarp/path/path.cpp index 2c9f62ea1..674686038 100644 --- a/llarp/path/path.cpp +++ b/llarp/path/path.cpp @@ -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); From 74f994953779849e42a530305ce88fcdca03f87b Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 27 Mar 2019 16:33:15 -0400 Subject: [PATCH 3/3] aaaaaa --- llarp/service/endpoint.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index a6ff3c71a..09da10cd5 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -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)