Browse Source

Tighten a few timings.

Adam Ierymenko 8 years ago
parent
commit
9cfc109527
2 changed files with 4 additions and 4 deletions
  1. 2 2
      node/Constants.hpp
  2. 2 2
      node/Switch.cpp

+ 2 - 2
node/Constants.hpp

@@ -226,12 +226,12 @@
 /**
 /**
  * Delay between WHOIS retries in ms
  * 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)
  * 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
  * Transmit queue entry timeout

+ 2 - 2
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.
 	{	// Time out TX queue packets that never got WHOIS lookups or other info.
 		Mutex::Lock _l(_txQueue_m);
 		Mutex::Lock _l(_txQueue_m);
 		for(std::list< TXQueueEntry >::iterator txi(_txQueue.begin());txi!=_txQueue.end();) {
 		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++);
 				_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);
 				RR->t->txTimedOut(tPtr,txi->dest);
 				_txQueue.erase(txi++);
 				_txQueue.erase(txi++);
 			} else ++txi;
 			} else ++txi;