From 9cfc10952748487bed318ec11221eeccbb285c89 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 23 Aug 2017 14:00:08 -0700 Subject: [PATCH] Tighten a few timings. --- node/Constants.hpp | 4 ++-- node/Switch.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/Constants.hpp b/node/Constants.hpp index 3f050ead7..27dce0751 100644 --- a/node/Constants.hpp +++ b/node/Constants.hpp @@ -226,12 +226,12 @@ /** * Delay between WHOIS retries in ms */ -#define ZT_WHOIS_RETRY_DELAY 1000 +#define ZT_WHOIS_RETRY_DELAY 500 /** * Maximum identity WHOIS retries (each attempt tries consulting a different peer) */ -#define ZT_MAX_WHOIS_RETRIES 4 +#define ZT_MAX_WHOIS_RETRIES 5 /** * Transmit queue entry timeout diff --git a/node/Switch.cpp b/node/Switch.cpp index 053f793ea..0d39bee97 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -630,9 +630,9 @@ unsigned long Switch::doTimerTasks(void *tPtr,uint64_t now) { // Time out TX queue packets that never got WHOIS lookups or other info. Mutex::Lock _l(_txQueue_m); for(std::list< TXQueueEntry >::iterator txi(_txQueue.begin());txi!=_txQueue.end();) { - if (_trySend(tPtr,txi->packet,txi->encrypt)) + if (_trySend(tPtr,txi->packet,txi->encrypt)) { _txQueue.erase(txi++); - else if ((now - txi->creationTime) > ZT_TRANSMIT_QUEUE_TIMEOUT) { + } else if ((now - txi->creationTime) > ZT_TRANSMIT_QUEUE_TIMEOUT) { RR->t->txTimedOut(tPtr,txi->dest); _txQueue.erase(txi++); } else ++txi;