summaryrefslogtreecommitdiff
path: root/node/Peer.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-03 13:14:37 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-03 13:14:37 -0700
commitee0f56355bd7b1d2798a750fb02a975b526dd9cf (patch)
tree4fd593ed94b68cf79996246d1410d89bda9c7aa3 /node/Peer.cpp
parenta69e1876f10266e5578be0a469ae7498f705fe96 (diff)
downloadinfinitytier-ee0f56355bd7b1d2798a750fb02a975b526dd9cf.tar.gz
infinitytier-ee0f56355bd7b1d2798a750fb02a975b526dd9cf.zip
Send path simplification.
Diffstat (limited to 'node/Peer.cpp')
-rw-r--r--node/Peer.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp
index 294c02bf..0bff2aae 100644
--- a/node/Peer.cpp
+++ b/node/Peer.cpp
@@ -43,7 +43,6 @@ Peer::Peer(const Identity &myIdentity,const Identity &peerIdentity)
_lastUnicastFrame(0),
_lastMulticastFrame(0),
_lastAnnouncedTo(0),
- _lastSpammed(0),
_vMajor(0),
_vMinor(0),
_vRevision(0),
@@ -147,31 +146,6 @@ void Peer::received(
_lastMulticastFrame = now;
}
-bool Peer::send(const RuntimeEnvironment *RR,const void *data,unsigned int len,uint64_t now)
-{
- Path *bestPath = (Path *)0;
- uint64_t lrMax = 0;
- for(unsigned int p=0,np=_numPaths;p<np;++p) {
- if ((_paths[p].active(now)&&(_paths[p].lastReceived() >= lrMax)) {
- lrMax = _paths[p].lastReceived();
- bestPath = &(_paths[p]);
- }
- }
-
- if (bestPath) {
- bool spam = ((now - _lastSpammed) >= ZT_DESPERATION_SPAM_INTERVAL);
- if (RR->node->putPacket(bestPath->address(),data,len,bestPath->desperation(),spam)) {
- bestPath->sent(now);
- RR->antiRec->logOutgoingZT(data,len);
- if (spam)
- _lastSpammed = now;
- return true;
- }
- }
-
- return false;
-}
-
void Peer::addPath(const Path &newp)
{
unsigned int np = _numPaths;