Browse Source

Fix (1) a deadlock bug and (2) a bug that prevented distributed rendezvous messages from being sent.

Adam Ierymenko 9 years ago
parent
commit
47424df417
2 changed files with 3 additions and 1 deletions
  1. 1 0
      node/Cluster.cpp
  2. 2 1
      node/Switch.cpp

+ 1 - 0
node/Cluster.cpp

@@ -395,6 +395,7 @@ void Cluster::sendViaCluster(const Address &fromPeerAddress,const Address &toPee
 				mostRecentTs = rpe->second;
 				mostRecentMemberId = rpe->first.second;
 			}
+			++rpe;
 		}
 	}
 

+ 2 - 1
node/Switch.cpp

@@ -720,7 +720,8 @@ void Switch::_handleRemotePacketHead(const InetAddress &localAddr,const InetAddr
 						Mutex::Lock _l(_lastUniteAttempt_m);
 						uint64_t &luts = _lastUniteAttempt[_LastUniteKey(source,destination)];
 						shouldUnite = ((now - luts) >= ZT_MIN_UNITE_INTERVAL);
-						luts = now;
+						if (shouldUnite)
+							luts = now;
 					}
 					RR->cluster->sendViaCluster(source,destination,packet->data(),packet->size(),shouldUnite);
 					return;