From ff5e22031aa005d4bcb0839797ac4044f6992e50 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 8 Aug 2017 13:24:37 -0700 Subject: [PATCH] Small fix: should expire packets to prevent repeated WHOISes. --- node/Switch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node/Switch.cpp b/node/Switch.cpp index c509ef164..053f793ea 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -580,10 +580,11 @@ void Switch::doAnythingWaitingForPeer(void *tPtr,const SharedPtr &peer) } // finish processing any packets waiting on peer's public key / identity + const uint64_t now = RR->node->now(); for(unsigned int ptr=0;ptrtimestamp)&&(rq->complete)) { - if (rq->frag0.tryDecode(RR,tPtr)) + if ((rq->frag0.tryDecode(RR,tPtr))||((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT)) rq->timestamp = 0; } }