From 0b73f2b1322943910d5454460ef557daad95c0fb Mon Sep 17 00:00:00 2001 From: hermens Date: Thu, 24 Aug 2006 01:31:08 +0000 Subject: [PATCH] Repair DNS prefetch during cacheScan git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2451 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaHTCache.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java index 58a88f363..9baea0cc4 100644 --- a/source/de/anomic/plasma/plasmaHTCache.java +++ b/source/de/anomic/plasma/plasmaHTCache.java @@ -431,7 +431,21 @@ public final class plasmaHTCache { int p = s.indexOf("/"); if (p < 0) p = s.indexOf("\\"); if (p < 0) return null; - return s.substring(0, p); + // remove the protokoll + s = s.substring(p + 1); + p = s.indexOf("/"); + if (p < 0) p = s.indexOf("\\"); + if (p < 0) return null; + String prefix = new String(""); + if (s.startsWith("www")) prefix = new String("www."); + // remove the www|other|ip directory + s = s.substring(p + 1); + p = s.indexOf("/"); + if (p < 0) p = s.indexOf("\\"); + if (p < 0) return null; + int e = s.indexOf("!"); + if ((e > 0) && (e < p)) p = e; // strip port + return prefix + s.substring(0, p); } public httpHeader getCachedResponse(String urlHash) throws IOException {