Author: orbiter
Date: 2008-02-03 12:21:50 +0100 (Sun, 03 Feb 2008)
New Revision: 4433

Modified:
   trunk/source/de/anomic/plasma/plasmaHTCache.java
Log:
fix for HTCache organisation that may have caused unlimited grow of the cache
appeared only for tree-caches

Modified: trunk/source/de/anomic/plasma/plasmaHTCache.java
===================================================================
--- trunk/source/de/anomic/plasma/plasmaHTCache.java    2008-02-03 02:55:21 UTC 
(rev 4432)
+++ trunk/source/de/anomic/plasma/plasmaHTCache.java    2008-02-03 11:21:50 UTC 
(rev 4433)
@@ -809,11 +809,13 @@
     
     
     /**
-     * This is a helper funktion that extracts the Hash from the filename
+     * This is a helper function that extracts the Hash from the filename
      */
     public static String getHash(final File f) {
         if ((!f.isFile()) || (f.getPath().indexOf("hash") < 0)) return null;
-        String hexHash = f.getName().substring(0,18);
+        String name = f.getName();
+        if (name.length() < 18) return null; // not a hash file name
+        String hexHash = name.substring(0,18);
         if (hexHash.indexOf('.') >= 0) return null;
         try {
             String hash = 
kelondroBase64Order.enhancedCoder.encode(serverCodings.decodeHex(hexHash));

_______________________________________________
YaCy-svn mailing list
YaCy-svn@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/yacy-svn

Antwort per Email an