From e9163e7e1094120146007ee7a159f421b46e8e3e Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 29 Jul 2014 11:18:45 +0200 Subject: [PATCH] fix for malformed hostpath names in crawl balancer --- source/net/yacy/crawler/HostBalancer.java | 2 +- source/net/yacy/crawler/HostQueue.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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(); 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();