From d93325a578701ef204c81a3d70fe43fe9eb6994d Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 5 Oct 2014 14:50:22 +0200 Subject: [PATCH 1/2] lazy handling of process_sxt field (part of postprocessing) --- source/net/yacy/search/schema/CollectionConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.java index 657b419ee..60edc3328 100644 --- a/source/net/yacy/search/schema/CollectionConfiguration.java +++ b/source/net/yacy/search/schema/CollectionConfiguration.java @@ -1278,9 +1278,9 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri Collection proctags = doc.getFieldValues(CollectionSchema.process_sxt.getSolrFieldName()); final String u = (String) doc.getFieldValue(CollectionSchema.sku.getSolrFieldName()); final String i = (String) doc.getFieldValue(CollectionSchema.id.getSolrFieldName()); - if (proctags == null) { + if (proctags == null || proctags.size() == 0) { // this should not happen since we collected the documents using a process_sxt:[* TO *] term - ConcurrentLog.warn("CollectionConfiguration", "no process_sxt entry for url " + u); + ConcurrentLog.warn("CollectionConfiguration", "no process_sxt entry for url " + u + ", id=" + i); continue; } try { From c27bad93266b931b3592eca5b9c57b7416283963 Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 7 Oct 2014 20:09:48 +0200 Subject: [PATCH 2/2] more ipv6 fixes --- source/net/yacy/peers/Protocol.java | 5 +++-- source/net/yacy/peers/SeedDB.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) 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 targetIPs(final String targetHash) { + // find target address + Set 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 {