From ee0f56355bd7b1d2798a750fb02a975b526dd9cf Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 3 Apr 2015 13:14:37 -0700 Subject: Send path simplification. --- node/Peer.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'node/Peer.cpp') 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= 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; -- cgit v1.2.3