summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-09 13:39:06 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-09 13:39:06 -0800
commit47424df417dcbeec9e6415a85176299604b0fde2 (patch)
tree60028c2e16e401606a2ccb99673c88b8cea6d578
parent73e2c6e5117aba36566c22edc1c19c8d6347d317 (diff)
downloadinfinitytier-47424df417dcbeec9e6415a85176299604b0fde2.tar.gz
infinitytier-47424df417dcbeec9e6415a85176299604b0fde2.zip
Fix (1) a deadlock bug and (2) a bug that prevented distributed rendezvous messages from being sent.
-rw-r--r--node/Cluster.cpp1
-rw-r--r--node/Switch.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/node/Cluster.cpp b/node/Cluster.cpp
index ec115159..419948e2 100644
--- a/node/Cluster.cpp
+++ b/node/Cluster.cpp
@@ -395,6 +395,7 @@ void Cluster::sendViaCluster(const Address &fromPeerAddress,const Address &toPee
mostRecentTs = rpe->second;
mostRecentMemberId = rpe->first.second;
}
+ ++rpe;
}
}
diff --git a/node/Switch.cpp b/node/Switch.cpp
index 7caf8ba6..dcaf7ebd 100644
--- a/node/Switch.cpp
+++ b/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;