Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5899 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 29, 2009
1 parent 0e01e84 commit d31e6f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion htroot/ConfigNetwork_p.java
Expand Up @@ -207,7 +207,10 @@ public static serverObjects respond(final httpRequestHeader header, final server
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");
Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -924,7 +924,7 @@ public boolean isInMyCluster(final String peer) {
return network.indexOf(peer) >= 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;
}
Expand All @@ -942,7 +942,7 @@ public boolean isInMyCluster(final yacySeed seed) {
return network.indexOf(seed.getPublicAddress()) >= 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;
}
Expand Down
8 changes: 4 additions & 4 deletions source/de/anomic/yacy/yacyCore.java
Expand Up @@ -310,19 +310,19 @@ private int publishMySeed(final boolean force) {
// add also all peers from cluster if this is a public robinson cluster
if (ch != null) {
final Iterator<Map.Entry<byte[], String>> i = ch.entrySet().iterator();
byte[] hash;
String hash;
Map.Entry<byte[], String> 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 {
Expand Down

0 comments on commit d31e6f9

Please sign in to comment.