From 218cd6561cacabfa14554cd1bac391a537a82740 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 15 Feb 2006 22:12:53 +0000 Subject: [PATCH] fixed problem with wrong hash length in file share see: http://www.yacy-forum.de/viewtopic.php?p=16565#16565 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1658 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/yacySeedDB.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java index aef7d89e3..1d405e4b8 100644 --- a/source/de/anomic/yacy/yacySeedDB.java +++ b/source/de/anomic/yacy/yacySeedDB.java @@ -733,11 +733,17 @@ public final class yacySeedDB { subdom = host.substring(0, p); host = host.substring(p + 1); } + // check if we have a b64-hash or a hex-hash + String hash = host.substring(0, host.length() - 6); + if (hash.length() > commonHashLength) { + // this is probably a hex-hash + hash = yacySeed.hexHash2b64Hash(hash); + } // check remote seeds - seed = getConnected(host.substring(0, host.length() - 6)); // checks only remote, not local + seed = getConnected(hash); // checks only remote, not local // check local seed if (seed == null) { - if (host.substring(0, host.length() - 6).equals(mySeed.hash)) + if (hash.equals(mySeed.hash)) seed = mySeed; else return null; }