From d9006712f6ffc975d97097caf2d2b4264405b32c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 21 May 2015 15:58:26 -0700 Subject: 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. --- node/Node.hpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'node/Node.hpp') diff --git a/node/Node.hpp b/node/Node.hpp index 70531bf8..f8678115 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -79,7 +79,6 @@ public: ZT1_ResultCode processWirePacket( uint64_t now, const struct sockaddr_storage *remoteAddress, - unsigned int linkDesperation, const void *packetData, unsigned int packetLength, volatile uint64_t *nextBackgroundTaskDeadline); @@ -119,16 +118,14 @@ public: * @param addr Destination address * @param data Packet data * @param len Packet length - * @param desperation Link desperation for reaching this address * @return True if packet appears to have been sent */ - inline bool putPacket(const InetAddress &addr,const void *data,unsigned int len,unsigned int desperation) + inline bool putPacket(const InetAddress &addr,const void *data,unsigned int len) { return (_wirePacketSendFunction( reinterpret_cast(this), _uPtr, reinterpret_cast(&addr), - desperation, data, len) == 0); } @@ -174,23 +171,6 @@ public: return nw; } - /** - * Get an overall current level of desperation - * - * The current level of desperation is based on how recently an upstream - * (a.k.a. supernode) peer has spoken to us. As such, it will change and - * return to 0 once something like tunneling (higher desperation link) is - * active. As a result, actual link desperation for outgoing messages - * should be the max of either this or the most recent link desperation - * for an incoming message from a given address. See Path.hpp and Peer.hpp. - * - * In other words think of this as 'the desperation we should try to - * escalate to right now.' - * - * @return Overall system level of desperation - */ - inline unsigned int coreDesperation() const throw() { return _coreDesperation; } - inline bool dataStorePut(const char *name,const void *data,unsigned int len,bool secure) { return (_dataStorePutFunction(reinterpret_cast(this),_uPtr,name,data,len,(int)secure) == 0); } inline bool dataStorePut(const char *name,const std::string &data,bool secure) { return dataStorePut(name,(const void *)data.data(),(unsigned int)data.length(),secure); } inline void dataStoreDelete(const char *name) { _dataStorePutFunction(reinterpret_cast(this),_uPtr,name,(const void *)0,0,0); } @@ -253,7 +233,6 @@ private: uint64_t _lastPingCheck; uint64_t _lastHousekeepingRun; uint64_t _lastBeacon; - unsigned int _coreDesperation; unsigned int _newestVersionSeen[3]; // major, minor, revision bool _online; }; -- cgit v1.2.3