From a9ca26c6985d10d1c86a33c56b06c1ae679cda0f Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Thu, 7 Jun 2018 12:58:07 -0700 Subject: Added TX queue cap for issue #769 --- node/Switch.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'node/Switch.cpp') diff --git a/node/Switch.cpp b/node/Switch.cpp index eb1ebadb..3fa8c31d 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -503,6 +503,9 @@ void Switch::send(void *tPtr,Packet &packet,bool encrypt) if (!_trySend(tPtr,packet,encrypt)) { { Mutex::Lock _l(_txQueue_m); + if (_txQueue.size() >= ZT_TX_QUEUE_SIZE) { + _txQueue.pop_front(); + } _txQueue.push_back(TXQueueEntry(dest,RR->node->now(),packet,encrypt)); } if (!RR->topology->getPeer(tPtr,dest)) -- cgit v1.2.3