From 860891b6a665e78d74982d85fb598e293ae9ad11 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 18 Jan 2020 16:59:50 -0500 Subject: [PATCH] tail drop --- llarp/router/outbound_message_handler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/llarp/router/outbound_message_handler.cpp b/llarp/router/outbound_message_handler.cpp index 9e2e1b640..4aede4147 100644 --- a/llarp/router/outbound_message_handler.cpp +++ b/llarp/router/outbound_message_handler.cpp @@ -278,14 +278,15 @@ namespace llarp } MessageQueue &path_queue = itr_pair.first->second; - /* - if(path_queue.size() >= MAX_PATH_QUEUE_SIZE) + + if(path_queue.size() < MAX_PATH_QUEUE_SIZE) + { + path_queue.push(std::move(entry)); + } + else { m_queueStats.dropped++; - path_queue.pop(); // head drop } - */ - path_queue.push(std::move(entry)); } }