summaryrefslogtreecommitdiff
path: root/node/Path.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-21 15:58:26 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-05-21 15:58:26 -0700
commitd9006712f6ffc975d97097caf2d2b4264405b32c (patch)
tree3f9fb8236829331e0c2dc868aa5c97517794ca16 /node/Path.hpp
parent123ff28863d9aa8afb573154ea59cf72532aaec5 (diff)
downloadinfinitytier-d9006712f6ffc975d97097caf2d2b4264405b32c.tar.gz
infinitytier-d9006712f6ffc975d97097caf2d2b4264405b32c.zip
Completely factor out "desperation" from the core. I thought of a significantly simpler way to move all of this logic entirely into the containing service, liberating the core from any concern over the nature of its pipe to the outside world.
Diffstat (limited to 'node/Path.hpp')
-rw-r--r--node/Path.hpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/node/Path.hpp b/node/Path.hpp
index 4a8e837d..393b7225 100644
--- a/node/Path.hpp
+++ b/node/Path.hpp
@@ -57,7 +57,6 @@ public:
_addr(),
_lastSend(0),
_lastReceived(0),
- _lastReceiveDesperation(0),
_fixed(false) {}
Path(const Path &p) throw() { memcpy(this,&p,sizeof(Path)); }
@@ -66,7 +65,6 @@ public:
_addr(addr),
_lastSend(0),
_lastReceived(0),
- _lastReceiveDesperation(0),
_fixed(fixed) {}
inline void init(const InetAddress &addr,bool fixed)
@@ -74,7 +72,6 @@ public:
_addr = addr;
_lastSend = 0;
_lastReceived = 0;
- _lastReceiveDesperation = 0;
_fixed = fixed;
}
@@ -107,13 +104,11 @@ public:
* Called when a packet is received from this path
*
* @param t Time of receive
- * @param d Link desperation of receive
*/
- inline void received(uint64_t t,unsigned int d)
+ inline void received(uint64_t t)
throw()
{
_lastReceived = t;
- _lastReceiveDesperation = d;
}
/**
@@ -127,11 +122,6 @@ public:
inline void setFixed(bool f) throw() { _fixed = f; }
/**
- * @return Last desperation reported via incoming link
- */
- inline unsigned int lastReceiveDesperation() const throw() { return _lastReceiveDesperation; }
-
- /**
* @param now Current time
* @return True if this path is fixed or has received data in last ACTIVITY_TIMEOUT ms
*/
@@ -152,7 +142,7 @@ public:
*/
inline bool send(const RuntimeEnvironment *RR,const void *data,unsigned int len,uint64_t now)
{
- if (RR->node->putPacket(_addr,data,len,std::max(RR->node->coreDesperation(),_lastReceiveDesperation))) {
+ if (RR->node->putPacket(_addr,data,len)) {
sent(now);
RR->antiRec->logOutgoingZT(data,len);
return true;
@@ -187,7 +177,6 @@ private:
InetAddress _addr;
uint64_t _lastSend;
uint64_t _lastReceived;
- unsigned int _lastReceiveDesperation;
bool _fixed;
};