Skip to content

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

fix for malformed hostpath names in crawl balancer

orbitere9163e7e1094
diff --git a/source/net/yacy/crawler/HostBalancer.java b/source/net/yacy/crawler/HostBalancer.java
index aea99a956..0d1d985fc 100644
--- a/source/net/yacy/crawler/HostBalancer.java
+++ b/source/net/yacy/crawler/HostBalancer.java
@@ -91,7 +91,7 @@ public class HostBalancer implements Balancer {
} else {
this.queues.put(DigestURL.hosthash(queue.getHost(), queue.getPort()), queue);
}
- } catch (MalformedURLException e) {
+ } catch (MalformedURLException|RuntimeException e) {
ConcurrentLog.logException(e);
}
this.roundRobinHostHashes = new HashSet<String>();
diff --git a/source/net/yacy/crawler/HostQueue.java b/source/net/yacy/crawler/HostQueue.java
index 182f8b348..549392543 100644
--- a/source/net/yacy/crawler/HostQueue.java
+++ b/source/net/yacy/crawler/HostQueue.java
@@ -95,6 +95,7 @@ public class HostQueue implements Balancer {
// parse the hostName and port from the file name
String filename = hostPath.getName();
int p = filename.lastIndexOf('.');
+ if (p < 0) throw new RuntimeException("hostPath name must contain a dot: " + filename);
this.hostName = filename.substring(0, p);
this.port = Integer.parseInt(filename.substring(p + 1));
init();