summaryrefslogtreecommitdiff
path: root/node/Multicaster.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-17 16:11:57 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-17 16:11:57 -0400
commitf9079a110ee8336a8403efe466e2a75620c95ab1 (patch)
tree887584d8d1f538f517e1564479697745a1237d90 /node/Multicaster.hpp
parent4c06fcfc9dd0ba25ec2c50ce03f10f1d93f168f5 (diff)
downloadinfinitytier-f9079a110ee8336a8403efe466e2a75620c95ab1.tar.gz
infinitytier-f9079a110ee8336a8403efe466e2a75620c95ab1.zip
Make network multicast breadth/depth parameters configurable on a per-net basis.
Diffstat (limited to 'node/Multicaster.hpp')
-rw-r--r--node/Multicaster.hpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp
index 77c7c532..c7e34d2f 100644
--- a/node/Multicaster.hpp
+++ b/node/Multicaster.hpp
@@ -52,9 +52,6 @@
#include "CMWC4096.hpp"
#include "C25519.hpp"
-// Maximum sample size to pick during choice of multicast propagation peers
-#define ZT_MULTICAST_PICK_MAX_SAMPLE_SIZE (ZT_MULTICAST_PROPAGATION_BREADTH * 8)
-
namespace ZeroTier {
/**
@@ -253,7 +250,7 @@ public:
Mutex::Lock _l(_multicastMemberships_m);
std::map< MulticastChannel,std::vector<MulticastMembership> >::iterator mm(_multicastMemberships.find(MulticastChannel(nwid,mg)));
if ((mm != _multicastMemberships.end())&&(!mm->second.empty())) {
- for(unsigned int stries=0;((stries<ZT_MULTICAST_PICK_MAX_SAMPLE_SIZE)&&(chosen < max));++stries) {
+ for(unsigned int stries=0,stmax=(max*10);((stries<stmax)&&(chosen < max));++stries) {
MulticastMembership &m = mm->second[prng.next32() % mm->second.size()];
unsigned int sum = m.first.sum();
if (
@@ -320,7 +317,7 @@ public:
Mutex::Lock _l(_multicastMemberships_m);
std::map< MulticastChannel,std::vector<MulticastMembership> >::iterator mm(_multicastMemberships.find(MulticastChannel(nwid,mg)));
if ((mm != _multicastMemberships.end())&&(!mm->second.empty())) {
- for(unsigned int stries=0;stries<ZT_MULTICAST_PICK_MAX_SAMPLE_SIZE;++stries) {
+ for(unsigned int stries=0,stmax=(max*10);stries<stmax;++stries) {
MulticastMembership &m = mm->second[prng.next32() % mm->second.size()];
if (
((now - m.second) < ZT_MULTICAST_LIKE_EXPIRE)&& /* LIKE is not expired */