summaryrefslogtreecommitdiff
path: root/node/IncomingPacket.cpp
diff options
context:
space:
mode:
authorJoseph Henry <josephjah@gmail.com>2018-06-07 15:26:18 -0700
committerJoseph Henry <josephjah@gmail.com>2018-06-07 15:26:18 -0700
commitb6d97af4514ec433bfbb6d8e6b696a8d62e98bef (patch)
treebbf15f7423e6883537662cf7aa0c95c176cabb8a /node/IncomingPacket.cpp
parentb9975845fffc087c138df4934831f9ef40e61ad6 (diff)
downloadinfinitytier-b6d97af4514ec433bfbb6d8e6b696a8d62e98bef.tar.gz
infinitytier-b6d97af4514ec433bfbb6d8e6b696a8d62e98bef.zip
Added rate gates for QOS and ACK packets
Diffstat (limited to 'node/IncomingPacket.cpp')
-rw-r--r--node/IncomingPacket.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index c6d19021..70dcff5d 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -204,6 +204,8 @@ bool IncomingPacket::_doERROR(const RuntimeEnvironment *RR,void *tPtr,const Shar
bool IncomingPacket::_doACK(const RuntimeEnvironment *RR,void *tPtr,const SharedPtr<Peer> &peer)
{
+ if (!peer->rateGateACK(RR->node->now()))
+ return true;
/* Dissect incoming ACK packet. From this we can estimate current throughput of the path, establish known
* maximums and detect packet loss. */
if (peer->localMultipathSupport()) {
@@ -220,6 +222,8 @@ bool IncomingPacket::_doACK(const RuntimeEnvironment *RR,void *tPtr,const Shared
}
bool IncomingPacket::_doQOS_MEASUREMENT(const RuntimeEnvironment *RR,void *tPtr,const SharedPtr<Peer> &peer)
{
+ if (!peer->rateGateQoS(RR->node->now()))
+ return true;
/* Dissect incoming QoS packet. From this we can compute latency values and their variance.
* The latency variance is used as a measure of "jitter". */
if (peer->localMultipathSupport()) {