Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

more ipv6 fixes

orbiterc27bad93266b
diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.java
index 2cdc5f14c..44d73a6b6 100644
--- a/source/net/yacy/peers/Protocol.java
+++ b/source/net/yacy/peers/Protocol.java
@@ -503,7 +503,8 @@ public final class Protocol {
final long timestamp = System.currentTimeMillis();
event.addExpectedRemoteReferences(count);
SearchResult result;
- String clusteraddress = target.getPublicAddress(target.getIP());
+ String ip = target.getIP();
+ String clusteraddress = target.getPublicAddress(ip);
if (target.clash(event.peers.mySeed().getIPs())) clusteraddress = "localhost:" + event.peers.mySeed().getPort();
try {
result =
@@ -525,7 +526,7 @@ public final class Protocol {
);
} catch (final IOException e ) {
Network.log.info("SEARCH failed, Peer: " + target.hash + ":" + target.getName() + " (" + e.getMessage() + ")");
- event.peers.peerActions.peerDeparture(target, "search request to peer created io exception: " + e.getMessage());
+ event.peers.peerActions.interfaceDeparture(target, ip);
return -1;
}
// computation time
diff --git a/source/net/yacy/peers/SeedDB.java b/source/net/yacy/peers/SeedDB.java
index 2852dadad..a401dd83a 100644
--- a/source/net/yacy/peers/SeedDB.java
+++ b/source/net/yacy/peers/SeedDB.java
@@ -966,6 +966,7 @@ public final class SeedDB implements AlternativeDomainNames {
}
}
+ @Deprecated
public String targetAddress(final String targetHash) {
// find target address
String address;
@@ -979,6 +980,19 @@ public final class SeedDB implements AlternativeDomainNames {
if (address == null) address = "localhost" + (this.mySeed.getPort() > 0 ? ":" + this.mySeed.getPort() : "");
return address;
}
+
+ public Set<String> targetIPs(final String targetHash) {
+ // find target address
+ Set<String> ips;
+ if (targetHash.equals(mySeed().hash)) {
+ ips = mySeed().getIPs();
+ } else {
+ final Seed targetSeed = getConnected(targetHash);
+ if (targetSeed == null) { return null; }
+ ips = targetSeed.getIPs();
+ }
+ return ips;
+ }
private class seedEnum implements Iterator<Seed> {