mark paths as dead when they need to and revert codel changes

pull/66/head
Jeff Becker 6 years ago
parent ffccb058c4
commit e3dc4dca11
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -101,16 +101,9 @@ namespace llarp
return Process(v, [](T&) -> bool { return false; });
}
template < typename Visit >
void
ProcessN(size_t N, Visit v)
{
Process(v, [](T&) -> bool { return false; }, N);
}
template < typename Visit, typename Filter >
void
Process(Visit visitor, Filter f, size_t N = MaxSize)
Process(Visit visitor, Filter f)
{
llarp_time_t lowest = std::numeric_limits< llarp_time_t >::max();
if(_getNow() < nextTickAt)
@ -131,8 +124,6 @@ namespace llarp
size_t idx = 0;
while(m_QueueIdx)
{
--N;
llarp::LogDebug(m_name, " - queue has ", m_QueueIdx);
T* item = &m_Queue[idx++];
if(f(*item))
@ -141,7 +132,7 @@ namespace llarp
auto dlt = start - _getTime(*item);
// llarp::LogInfo("CoDelQueue::Process - dlt ", dlt);
lowest = std::min(dlt, lowest);
if(m_QueueIdx == 0 || N == 0)
if(m_QueueIdx == 0)
{
// llarp::LogInfo("CoDelQueue::Process - single item: lowest ",
// lowest, " dropMs: ", dropMs);

@ -41,7 +41,7 @@ namespace llarp
ExitEndpoint::FlushInbound()
{
auto now = Router()->Now();
m_InetToNetwork.ProcessN(256, [&](Pkt_t &pkt) {
m_InetToNetwork.Process([&](Pkt_t &pkt) {
llarp::PubKey pk;
{
auto itr = m_IPToKey.find(pkt.dst());

@ -447,6 +447,17 @@ namespace llarp
// check to see if this path is dead
if(_status == ePathEstablished)
{
if(SupportsRoles(ePathRoleExit))
{
if(m_LastRecvMessage && now > m_LastRecvMessage
&& now - m_LastRecvMessage > PATH_ALIVE_TIMEOUT)
{
// TODO: send close message
// r->routerProfiling.MarkPathFail(this);
// EnterState(ePathTimeout, now);
return;
}
}
if(m_LastRecvMessage && now > m_LastRecvMessage
&& now - m_LastRecvMessage > PATH_ALIVE_TIMEOUT)
{

Loading…
Cancel
Save