diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-04-06 16:28:40 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-04-06 16:28:40 -0700 |
commit | 56096be8b6e3f67e3bdce25bee73d0fc0534b0d5 (patch) | |
tree | 05288b7bab2ebb52b3df2811fd4c39acb62fc236 /node/Switch.cpp | |
parent | 8ef78e7e7db53c190071034cc4c8e1bbbe70c619 (diff) | |
download | infinitytier-56096be8b6e3f67e3bdce25bee73d0fc0534b0d5.tar.gz infinitytier-56096be8b6e3f67e3bdce25bee73d0fc0534b0d5.zip |
Tweak new RX queue algorithm to "expire" old entries to prevent always needing to traverse the whole queue array.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r-- | node/Switch.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index 890a9465..968d1a4a 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -138,7 +138,7 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from // seeing a Packet::Fragment? Mutex::Lock _l(_rxQueue_m); - RXQueueEntry *const rq = _findRXQueueEntry(fragmentPacketId); + RXQueueEntry *const rq = _findRXQueueEntry(now,fragmentPacketId); if ((!rq->timestamp)||(rq->packetId != fragmentPacketId)) { // No packet found, so we received a fragment without its head. @@ -241,7 +241,7 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from // Packet is the head of a fragmented packet series Mutex::Lock _l(_rxQueue_m); - RXQueueEntry *const rq = _findRXQueueEntry(packetId); + RXQueueEntry *const rq = _findRXQueueEntry(now,packetId); if ((!rq->timestamp)||(rq->packetId != packetId)) { // If we have no other fragments yet, create an entry and save the head |