diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-27 12:01:00 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-27 12:01:00 -0700 |
commit | a1a0ee4edb0933c9b82abad8715def6a63049658 (patch) | |
tree | d9f2f31627756c243538c0e46f61eb27a90e1732 /node/SelfAwareness.cpp | |
parent | 54a99d8e32e3ee0aed222069e961d44ddd748399 (diff) | |
download | infinitytier-a1a0ee4edb0933c9b82abad8715def6a63049658.tar.gz infinitytier-a1a0ee4edb0933c9b82abad8715def6a63049658.zip |
Fix infinite loop in Cluster, clean up some stuff elsewhere, and back out rate limiting in PUSH_DIRECT_PATHS for now (but we will do something else to mitigate amplification attacks)
Diffstat (limited to 'node/SelfAwareness.cpp')
-rw-r--r-- | node/SelfAwareness.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/node/SelfAwareness.cpp b/node/SelfAwareness.cpp index 1b70f17c..81d19369 100644 --- a/node/SelfAwareness.cpp +++ b/node/SelfAwareness.cpp @@ -123,16 +123,16 @@ void SelfAwareness::iam(const Address &reporter,const InetAddress &reporterPhysi // For all peers for whom we forgot an address, send a packet indirectly if // they are still considered alive so that we will re-establish direct links. - SharedPtr<Peer> sn(RR->topology->getBestRoot()); - if (sn) { - RemotePath *snp = sn->getBestPath(now); - if (snp) { + SharedPtr<Peer> r(RR->topology->getBestRoot()); + if (r) { + RemotePath *rp = r->getBestPath(now); + if (rp) { for(std::vector< SharedPtr<Peer> >::const_iterator p(rset.peersReset.begin());p!=rset.peersReset.end();++p) { if ((*p)->alive(now)) { - TRACE("sending indirect NOP to %s via %s(%s) to re-establish link",(*p)->address().toString().c_str(),sn->address().toString().c_str(),snp->address().toString().c_str()); + TRACE("sending indirect NOP to %s via %s to re-establish link",(*p)->address().toString().c_str(),r->address().toString().c_str()); Packet outp((*p)->address(),RR->identity.address(),Packet::VERB_NOP); outp.armor((*p)->key(),true); - snp->send(RR,outp.data(),outp.size(),now); + rp->send(RR,outp.data(),outp.size(),now); } } } |