瀏覽代碼

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

Adam Ierymenko 9 年之前
父節點
當前提交
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);