Author: xor
Date: 2008-11-16 19:20:34 +0000 (Sun, 16 Nov 2008)
New Revision: 23660

Modified:
   trunk/plugins/WoT/IdentityInserter.java
   trunk/plugins/WoT/OwnIdentity.java
Log:
Try to repair identity insertion.

Modified: trunk/plugins/WoT/IdentityInserter.java
===================================================================
--- trunk/plugins/WoT/IdentityInserter.java     2008-11-16 19:03:57 UTC (rev 
23659)
+++ trunk/plugins/WoT/IdentityInserter.java     2008-11-16 19:20:34 UTC (rev 
23660)
@@ -50,6 +50,7 @@
  */
 public class IdentityInserter implements Runnable, ClientCallback {
        
+       private static final int STARTUP_DELAY = 1 * 60 * 1000;
        private static final int THREAD_PERIOD = 30 * 60 * 1000;
        
        /** A reference to the database */
@@ -87,7 +88,7 @@
                Logger.debug(this, "Identity inserter thread started.");
                
                try {
-                       Thread.sleep((long) (3*60*1000 * (0.5f + 
Math.random()))); // Let the node start up
+                       Thread.sleep((long) (STARTUP_DELAY * (0.5f + 
Math.random()))); // Let the node start up
                }
                catch (InterruptedException e)
                {
@@ -187,7 +188,7 @@
                
                        // Prepare the insert
                        ClientMetadata cmd = new ClientMetadata("text/xml");
-                       InsertBlock ib = new 
InsertBlock(tempB,cmd,identity.getInsertURI());
+                       InsertBlock ib = new 
InsertBlock(tempB,cmd,identity.getInsertURIWithFilename());
                        InsertContext ictx = client.getInsertContext(true);
                        
                        /* FIXME: are these parameters correct? */

Modified: trunk/plugins/WoT/OwnIdentity.java
===================================================================
--- trunk/plugins/WoT/OwnIdentity.java  2008-11-16 19:03:57 UTC (rev 23659)
+++ trunk/plugins/WoT/OwnIdentity.java  2008-11-16 19:20:34 UTC (rev 23660)
@@ -290,6 +290,10 @@
                return insertURI;
        }
        
+       public FreenetURI getInsertURIWithFilename() {
+               return getInsertURI().pushMetaString("identity.xml");
+       }
+       
        /**
         * Sets this OwnIdentity's insertURI. 
         * The key must be a USK or a SSK, and is stored as a USK anyway.

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to