Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
some bugfixes for the peer-ping process
orbitere0e7f86f8265
diff --git a/htroot/yacy/hello.java b/htroot/yacy/hello.javaindex 3bb13d927..e1ee1f0cd 100644--- a/htroot/yacy/hello.java+++ b/htroot/yacy/hello.java@@ -65,6 +65,9 @@ import de.anomic.yacy.yacyVersion;public final class hello {+ // example:+ // http://localhost:8080/yacy/hello.html?count=1&seed=p|{Hash=sCJ6Tq8T0N9x,IPType=∅,Port=8080,IP=,Uptime=8,rI=190,Version=0.10004882,PeerType=junior,UTC=+0200,RCount=0,sI=0,LastSeen=20080605103333,Name=intratest,CCount=5.0,SCount=40,news=,USpeed=0,CRTCnt=0,CRWCnt=0,BDate=20080605081349,rU=190,LCount=187,dct=1212668923654,ICount=2,sU=0,ISpeed=0,RSpeed=0.0,NCount=0,Flags=oooo}+public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> env) throws InterruptedException {plasmaSwitchboard sb = (plasmaSwitchboard) env;serverObjects prop = new serverObjects();@@ -98,8 +101,7 @@ public final class hello {return prop;}final yacySeed remoteSeed = yacySeed.genRemoteSeed(seed, key, true);- remoteSeed.setIP(ias.toString());-+// System.out.println("YACYHELLO: REMOTESEED=" + ((remoteSeed == null) ? "NULL" : remoteSeed.toString()));if ((remoteSeed == null) || (remoteSeed.hash == null)) {prop.put("message", "cannot parse your seed");@@ -136,7 +138,8 @@ public final class hello {remoteSeed.setIP(reportedip);urls = yacyClient.queryUrlCount(remoteSeed);} else {- prop.put("yourip", "unknown");+ prop.put("yourip", (ias == null) ? "" : ias.getHostAddress());+ remoteSeed.setIP((ias == null) ? "" : ias.getHostAddress());}// if the previous attempt (using the reported ip address) was not successful, try the ip wherediff --git a/htroot/yacy/query.java b/htroot/yacy/query.javaindex ecb699705..c07e23b33 100644--- a/htroot/yacy/query.java+++ b/htroot/yacy/query.java@@ -55,15 +55,19 @@ import de.anomic.yacy.yacyNetwork;public final class query {+ // example:+ // http://localhost:8080/yacy/query.html?youare=sCJ6Tq8T0N9x&object=lurlcount+public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> ss) {if (post == null || ss == null) { return null; }// return variable that accumulates replacementsfinal plasmaSwitchboard sb = (plasmaSwitchboard) ss;final serverObjects prop = new serverObjects();- if ((post == null) || (ss == null)) return prop;- if (!yacyNetwork.authentifyRequest(post, ss)) return prop;-+ if ((post == null) || (ss == null) || !yacyNetwork.authentifyRequest(post, ss)) {+ prop.put("response", "-1"); // request rejected+ return prop;+ }if ((sb.isRobinsonMode()) &&(!sb.isPublicRobinson()) &&diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex 9120cbc96..d2d75a10b 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -2706,7 +2706,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.yacyCore.log.logInfo("BOOTSTRAP: seed-list URL " + seedListFileURL + " too old (" + (header.age() / 86400000) + " days)");} else {ssc++;- final byte[] content = HttpClient.wget(url.toString(), reqHeader, null, (int) getConfigLong("bootstrapLoadTimeout", 6000));+ final byte[] content = HttpClient.wget(url.toString(), reqHeader, null, (int) getConfigLong("bootstrapLoadTimeout", 20000));seedList = nxTools.strings(content, "UTF-8");enu = seedList.iterator();lc = 0;diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.javaindex f4bd843ad..9ad6a431c 100644--- a/source/de/anomic/yacy/yacyClient.java+++ b/source/de/anomic/yacy/yacyClient.java@@ -117,9 +117,10 @@ public final class yacyClient {// generate requestpost.add(new StringPart("count", "20"));post.add(new StringPart("seed", mySeed.genSeedStr(salt)));- yacyCore.log.logFine("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' contacting peer at " + address);// send request- byte[] content = wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post, 10000, false);+ long start = System.currentTimeMillis();+ byte[] content = wput("http://" + address + "/yacy/hello.html", yacySeed.b64Hash2hexHash(otherHash) + ".yacyh", post, 15000, false);+ yacyCore.log.logInfo("yacyClient.publishMySeed thread '" + Thread.currentThread().getName() + "' contacted peer at " + address + ", received " + ((content == null) ? "null" : content.length) + " bytes, time = " + (System.currentTimeMillis() - start) + " milliseconds");result = nxTools.table(content, "UTF-8");break;} catch (Exception e) {