From d31e6f9c14673d46789f6a70497f2f34b7bd5d9c Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 29 Apr 2009 11:18:17 +0000 Subject: [PATCH] fix for http://forum.yacy-websuche.de/viewtopic.php?p=14457#p14457 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5899 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigNetwork_p.java | 5 ++++- source/de/anomic/plasma/plasmaSwitchboard.java | 4 ++-- source/de/anomic/yacy/yacyCore.java | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.java index 29e2ee920..5b14e1e46 100644 --- a/htroot/ConfigNetwork_p.java +++ b/htroot/ConfigNetwork_p.java @@ -207,7 +207,10 @@ public class ConfigNetwork_p { prop.put("robinson.checked", (indexDistribute || indexReceive) ? "0" : "1"); prop.putHTML("cluster.peers.ipport", sb.getConfig("cluster.peers.ipport", "")); prop.putHTML("cluster.peers.yacydomain", sb.getConfig("cluster.peers.yacydomain", "")); - prop.put("cluster.peers.yacydomain.hashes", (sb.clusterhashes.size() == 0) ? "" : sb.clusterhashes.toString()); + String hashes = ""; + for (byte[] h:sb.clusterhashes.keySet()) hashes += ", " + new String(h); + if (hashes.length() > 2) hashes = hashes.substring(2); + prop.put("cluster.peers.yacydomain.hashes", hashes); // set p2p mode flags prop.put("privatepeerChecked", (sb.getConfig("cluster.mode", "").equals("privatepeer")) ? "1" : "0"); diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 95f704c52..2e20e609b 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -924,7 +924,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch= 0; } else if (clustermode.equals(plasmaSwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER)) { // check if we got the request from a peer in the public cluster - return this.clusterhashes.containsKey(peer); + return this.clusterhashes.containsKey(peer.getBytes()); } else { return false; } @@ -942,7 +942,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch= 0; } else if (clustermode.equals(plasmaSwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER)) { // check if we got the request from a peer in the public cluster - return this.clusterhashes.containsKey(seed.hash); + return this.clusterhashes.containsKey(seed.hash.getBytes()); } else { return false; } diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.java index c827df363..5fcb10d82 100644 --- a/source/de/anomic/yacy/yacyCore.java +++ b/source/de/anomic/yacy/yacyCore.java @@ -310,19 +310,19 @@ public class yacyCore { // add also all peers from cluster if this is a public robinson cluster if (ch != null) { final Iterator> i = ch.entrySet().iterator(); - byte[] hash; + String hash; Map.Entry entry; yacySeed seed; while (i.hasNext()) { entry = i.next(); - hash = entry.getKey(); + hash = new String(entry.getKey()); seed = seeds.get(hash); if (seed == null) { - seed = sb.webIndex.peers().get(new String(hash)); + seed = sb.webIndex.peers().get(hash); if (seed == null) continue; } seed.setAlternativeAddress(entry.getValue()); - seeds.put(new String(hash), seed); + seeds.put(hash, seed); } } } else {