summaryrefslogtreecommitdiff
path: root/node/Peer.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-09-06 11:10:04 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-09-06 11:10:04 -0700
commit43780742b03ffa69fb1a1868f976ac03edce921b (patch)
tree3dfe11cba1a6783a279fcf6c9c33878ec8d7d614 /node/Peer.cpp
parent3790ebe77a90cdaad629f275c2c4294694626733 (diff)
downloadinfinitytier-43780742b03ffa69fb1a1868f976ac03edce921b.tar.gz
infinitytier-43780742b03ffa69fb1a1868f976ac03edce921b.zip
comments, docs
Diffstat (limited to 'node/Peer.cpp')
-rw-r--r--node/Peer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp
index 3701d9a1..110d67fd 100644
--- a/node/Peer.cpp
+++ b/node/Peer.cpp
@@ -138,6 +138,7 @@ void Peer::received(
if (verb == Packet::VERB_OK) {
Mutex::Lock _l(_paths_m);
+ // Since this is a new path, figure out where to put it (possibly replacing an old/dead one)
unsigned int slot;
if (_numPaths < ZT_MAX_PEER_NETWORK_PATHS) {
slot = _numPaths++;
@@ -157,6 +158,7 @@ void Peer::received(
if (worstSlot >= 0) {
slot = (unsigned int)worstSlot;
} else {
+ // If we can't find one with the same family, replace the worst of any family
slot = ZT_MAX_PEER_NETWORK_PATHS - 1;
for(unsigned int p=0;p<_numPaths;++p) {
const uint64_t s = _pathScore(p);