summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-21 14:51:32 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-21 14:51:32 -0400
commita0a9d5221381f52f06071cfdbf5d2331a96318d2 (patch)
tree3c6dd4c6a973a65dd7334fa68101a32e595cd8e2 /node
parent2efc9b31bdf9decea16b7103d92a134f0cd132d4 (diff)
downloadinfinitytier-a0a9d5221381f52f06071cfdbf5d2331a96318d2.tar.gz
infinitytier-a0a9d5221381f52f06071cfdbf5d2331a96318d2.zip
Bug fix in multicast changes.
Diffstat (limited to 'node')
-rw-r--r--node/Multicaster.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp
index 41fa7ff5..80d16688 100644
--- a/node/Multicaster.hpp
+++ b/node/Multicaster.hpp
@@ -251,8 +251,9 @@ public:
if (peer) {
unsigned int chk = 0;
while (chk < chosen) {
- if (peers[chk++] == peer)
+ if (peers[chk] == peer)
break;
+ ++chk;
}
if (chk == chosen) { /* not already picked */
peers[chosen++] = peer;
@@ -262,7 +263,7 @@ public:
}
}
}
- return 0;
+ return chosen;
}
/**
@@ -327,7 +328,9 @@ public:
/* Tack on a supernode if we have no next hops */
if (!chosen) {
- P peer = topology.getBestSupernode();
+ Address exclude[1];
+ exclude[0] = originalSubmitter; // if it came from a supernode, don't boomerang
+ P peer = topology.getBestSupernode(exclude,1,true);
if (peer)
peers[chosen++] = peer;
}