don't repeat process messages on link layer

pull/4/head
Jeff Becker 6 years ago
parent cc23d8ddbd
commit 54aed396c2
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -469,7 +469,7 @@ namespace iwp
bool
operator()(const InboundMessage *left, const InboundMessage *right)
{
return left->msgid > right->msgid;
return left->msgid < right->msgid;
}
};
@ -524,6 +524,7 @@ namespace iwp
InboundMessage::OrderCompare >
q;
recvqueue.Process(q);
bool increment = false;
while(q.size())
{
// TODO: is this right?
@ -536,7 +537,10 @@ namespace iwp
}
delete front;
q.pop();
increment = true;
}
if(increment)
++nextMsgID;
// TODO: this isn't right
return true;
}
@ -1809,14 +1813,11 @@ namespace iwp
}
++nextMsgID;
}
else
{
recvqueue.Put(new InboundMessage(id, msg));
success = process_inbound_queue();
}
}
else
{
llarp::Warn("out of order message expected ", nextMsgID, " but got ",
id);
recvqueue.Put(new InboundMessage(id, msg));
success = true;
}

@ -309,7 +309,7 @@ namespace llarp
Path::Tick(llarp_time_t now, llarp_router* r)
{
auto dlt = now - m_LastLatencyTestTime;
if(dlt > 5000)
if(dlt > 5000 && m_LastLatencyTestID == 0)
{
llarp::routing::PathLatencyMessage latency;
latency.T = rand();
@ -432,6 +432,7 @@ namespace llarp
Latency = llarp_time_now_ms() - m_LastLatencyTestTime;
llarp::Info("path latency is ", Latency, " ms for tx=", TXID(),
" rx=", RXID());
m_LastLatencyTestID = 0;
return true;
}
return false;

Loading…
Cancel
Save