Quellcode durchsuchen

Don't keep connections up longer than the alive timeout (unless they are relays or roots)

Adam Ierymenko vor 10 Jahren
Ursprung
Commit
489e1a5b83
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      node/Node.cpp

+ 4 - 2
node/Node.cpp

@@ -206,8 +206,10 @@ public:
 			}
 			}
 		}
 		}
 
 
-		if ((!p->doPingAndKeepalive(RR,_now))&&(stableEndpoint))
-			p->attemptToContactAt(RR,InetAddress(),stableEndpoint,_now);
+		if ((p->alive(_now))||(upstream)) {
+			if ((!p->doPingAndKeepalive(RR,_now))&&(stableEndpoint))
+				p->attemptToContactAt(RR,InetAddress(),stableEndpoint,_now);
+		}
 
 
 		if (upstream)
 		if (upstream)
 			lastReceiveFromUpstream = std::max(p->lastReceive(),lastReceiveFromUpstream);
 			lastReceiveFromUpstream = std::max(p->lastReceive(),lastReceiveFromUpstream);