Explorar o código

Make activity no longer a function of ping frequency, since this causes compatibility bugs when the latter was modified due to timer interactions with other versions.

Adam Ierymenko %!s(int64=9) %!d(string=hai) anos
pai
achega
63ec7e58d4
Modificáronse 2 ficheiros con 7 adicións e 2 borrados
  1. 6 1
      node/Constants.hpp
  2. 1 1
      node/Path.hpp

+ 6 - 1
node/Constants.hpp

@@ -260,7 +260,12 @@
 /**
 /**
  * Timeout for overall peer activity (measured from last receive)
  * Timeout for overall peer activity (measured from last receive)
  */
  */
-#define ZT_PEER_ACTIVITY_TIMEOUT ((ZT_PEER_DIRECT_PING_DELAY * 4) + ZT_PING_CHECK_INVERVAL)
+#define ZT_PEER_ACTIVITY_TIMEOUT 500000
+
+/**
+ * Timeout for path activity
+ */
+#define ZT_PATH_ACTIVITY_TIMEOUT ZT_PEER_ACTIVITY_TIMEOUT
 
 
 /**
 /**
  * No answer timeout to trigger dead path detection
  * No answer timeout to trigger dead path detection

+ 1 - 1
node/Path.hpp

@@ -127,7 +127,7 @@ public:
 	inline bool active(uint64_t now) const
 	inline bool active(uint64_t now) const
 		throw()
 		throw()
 	{
 	{
-		return (((now - _lastReceived) < ZT_PEER_ACTIVITY_TIMEOUT)&&(_probation < ZT_PEER_DEAD_PATH_DETECTION_MAX_PROBATION));
+		return (((now - _lastReceived) < ZT_PATH_ACTIVITY_TIMEOUT)&&(_probation < ZT_PEER_DEAD_PATH_DETECTION_MAX_PROBATION));
 	}
 	}
 
 
 	/**
 	/**