Browse Source

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

Adam Ierymenko 10 năm trước cách đây
mục cha
commit
489e1a5b83
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  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);