Author: j16sdiz
Date: 2008-07-10 11:54:09 +0000 (Thu, 10 Jul 2008)
New Revision: 21020

Modified:
   
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
Log:
allow shutdown while migrating

Modified: 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
===================================================================
--- 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
   2008-07-10 11:25:29 UTC (rev 21019)
+++ 
branches/saltedhashstore/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
   2008-07-10 11:54:09 UTC (rev 21020)
@@ -1496,7 +1496,7 @@

                                byte[] b = new byte[(int) entryTotalLength];

-                               while (true) {
+                               while (!shutdown) {
                                        int status = storeRAF.read(b);
                                        if (status != entryTotalLength)
                                                break;
@@ -1519,7 +1519,8 @@
                                }
                        } catch (IOException ioe) {
                        }
-                       storeFiles.delete();    
+                       if (!shutdown)
+                               storeFiles.delete();    
                }

                System.out.println(name + ": old salt hash-->new salt hash 
migrated: " + c + " keys(done)");


Reply via email to