浏览代码

Small fix: should expire packets to prevent repeated WHOISes.

Adam Ierymenko 8 年之前
父节点
当前提交
ff5e22031a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      node/Switch.cpp

+ 2 - 1
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;
 		}
 	}