diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-08-08 13:24:37 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-08-08 13:24:37 -0700 |
commit | ff5e22031aa005d4bcb0839797ac4044f6992e50 (patch) | |
tree | b3bf3160ff067fbbeb46557870c0741f8270a101 | |
parent | e3cf7567856267bc4f4af0f1fb857cab105602e8 (diff) | |
download | infinitytier-ff5e22031aa005d4bcb0839797ac4044f6992e50.tar.gz infinitytier-ff5e22031aa005d4bcb0839797ac4044f6992e50.zip |
Small fix: should expire packets to prevent repeated WHOISes.
-rw-r--r-- | node/Switch.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index c509ef16..053f793e 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -580,10 +580,11 @@ void Switch::doAnythingWaitingForPeer(void *tPtr,const SharedPtr<Peer> &peer) } // finish processing any packets waiting on peer's public key / identity + const uint64_t now = RR->node->now(); for(unsigned int ptr=0;ptr<ZT_RX_QUEUE_SIZE;++ptr) { RXQueueEntry *const rq = &(_rxQueue[ptr]); if ((rq->timestamp)&&(rq->complete)) { - if (rq->frag0.tryDecode(RR,tPtr)) + if ((rq->frag0.tryDecode(RR,tPtr))||((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT)) rq->timestamp = 0; } } |