[freenet-cvs] r15525 - trunk/freenet/src/freenet/node

toad at freenetproject.org toad at freenetproject.org
Wed Oct 24 15:50:52 UTC 2007


Author: toad
Date: 2007-10-24 15:50:51 +0000 (Wed, 24 Oct 2007)
New Revision: 15525

Modified:
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
   trunk/freenet/src/freenet/node/NodeCrypto.java
Log:
Add FNPPacketMangler.start(). Call transientKeyRekeyer.run() to set the initial transient key and to schedule it later.

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java	2007-10-24 15:47:05 UTC (rev 15524)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java	2007-10-24 15:50:51 UTC (rev 15525)
@@ -151,12 +151,18 @@
 		fullHeadersLengthMinimum = HEADERS_LENGTH_MINIMUM + sock.getHeadersLength();
 		fullHeadersLengthOneMessage = HEADERS_LENGTH_ONE_MESSAGE + sock.getHeadersLength();
 		logMINOR = Logger.shouldLog(Logger.MINOR, this);
-		
-		// Yeah there is a race condition... the key might be at 0 for a while...
-		// but it will get reset soonish and current runs will be invalidated.
-		node.executor.execute(transientKeyRekeyer, "JFK transientRekeyer");
 	}
+	
+	/**
+	 * Start up the FNPPacketMangler. By the time this is called, all objects will have been constructed,
+	 * but not all will have been started yet.
+	 */
+	public void start() {
+		// Run it directly so that the transient key is set.
+		transientKeyRekeyer.run();
+	}
 
+
 	/**
 	 * Packet format:
 	 *
@@ -2683,4 +2689,5 @@
 		}
 		return data;
 	}
+
 }

Modified: trunk/freenet/src/freenet/node/NodeCrypto.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeCrypto.java	2007-10-24 15:47:05 UTC (rev 15524)
+++ trunk/freenet/src/freenet/node/NodeCrypto.java	2007-10-24 15:50:51 UTC (rev 15525)
@@ -235,6 +235,7 @@
 	}
 
 	public void start(boolean disableHangchecker) {
+		packetMangler.start();
 		socket.start(disableHangchecker);
 	}
 	




More information about the cvs mailing list