فهرست منبع

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

Adam Ierymenko 10 سال پیش
والد
کامیت
489e1a5b83
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  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)
 			lastReceiveFromUpstream = std::max(p->lastReceive(),lastReceiveFromUpstream);