more ipv6 fixes

pull/1/head
orbiter 10 years ago
parent cddf884bc4
commit c27bad9326

@ -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

@ -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> {

Loading…
Cancel
Save