Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed connection of out-dated peers
orbiter3607159a9a76
diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.javaindex ea5aa8385..c0ec8f926 100644--- a/source/de/anomic/yacy/yacyPeerActions.java+++ b/source/de/anomic/yacy/yacyPeerActions.java@@ -268,6 +268,12 @@ public class yacyPeerActions {ctime = yacyCore.universalTime();}+ if (Math.abs(yacyCore.universalTime() - ctime) > 3600000) {+ // the new connection is out-of-age, we reject the connection+ yacyCore.log.logDebug("connect: rejecting out-dated peer '" + seed.getName() + "' from " + seed.getAddress());+ return false;+ }+// disconnection timelong dtime;yacySeed disconnectedSeed = seedDB.getDisconnected(seed.hash);@@ -286,7 +292,7 @@ public class yacyPeerActions {seed.setFlagDirectConnect(true);} else {// set connection flag- if ((yacyCore.universalTime() - ctime) > 120000) seed.setFlagDirectConnect(false); // 2 minutes+ if (Math.abs(yacyCore.universalTime() - ctime) > 120000) seed.setFlagDirectConnect(false); // 2 minutes}// update latest version number@@ -304,16 +310,6 @@ public class yacyPeerActions {yacyCore.log.logDebug("connect: rejecting disconnected peer '" + seed.getName() + "' from " + seed.getAddress());return false;}- if ((yacyCore.universalTime() - ctime) > 3600000) {- // the new connection is out-of-age, we reject the connection- yacyCore.log.logDebug("connect: rejecting out-dated peer '" + seed.getName() + "' from " + seed.getAddress());- return false;- }- if ((yacyCore.universalTime() - ctime) > 3600000) {- // the new connection is future-dated, we reject the connection- yacyCore.log.logDebug("connect: rejecting future-dated peer '" + seed.getName() + "' from " + seed.getAddress());- return false;- }}// this is a return of a lost peer