Author: toad
Date: 2006-06-03 01:24:05 +0000 (Sat, 03 Jun 2006)
New Revision: 9019
Modified:
trunk/freenet/src/freenet/node/Version.java
trunk/freenet/src/freenet/node/updater/NodeUpdater.java
Log:
776: Updating 95% done. Still need to make sure revocation works.
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-06-03 01:20:57 UTC (rev
9018)
+++ trunk/freenet/src/freenet/node/Version.java 2006-06-03 01:24:05 UTC (rev
9019)
@@ -18,7 +18,7 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- private static final int buildNumber = 771;
+ private static final int buildNumber = 776;
/** Oldest build of Fred we will talk to */
private static final int lastGoodBuild = 765;
Modified: trunk/freenet/src/freenet/node/updater/NodeUpdater.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdater.java 2006-06-03
01:20:57 UTC (rev 9018)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdater.java 2006-06-03
01:24:05 UTC (rev 9019)
@@ -69,6 +69,7 @@
this.revocationAlert = null;
this.revocationDNFCounter = 0;
this.node = n;
+ node.nodeUpdater = this;
this.currentVersion = Version.buildNumber();
this.availableVersion = currentVersion;
this.hasBeenBlown = false;
@@ -120,6 +121,11 @@
if(found > availableVersion){
this.availableVersion = found;
+ node.ps.queueTimedJob(new Runnable() {
+ public void run() {
+ maybeUpdate();
+ }
+ }, 30*1000); // leave some time in case we get later
editions
try{
maybeUpdate();
}catch (Exception e){
@@ -159,11 +165,19 @@
}
}
+ private Object updateSync = new Object();
+
+ public void Update() {
+ synchronized(updateSync) {
+ innerUpdate();
+ }
+ }
+
/**
* We try to update the node :p
* Must run on its own thread.
*/
- public void Update(){
+ void innerUpdate(){
Logger.minor(this, "Update() called");
synchronized(this) {
if((result == null) || hasBeenBlown) {
@@ -429,7 +443,7 @@
Update();
}
- }, 50);
+ }, 500); // give it time to get close-together next version
}
public void onSuccess(BaseClientPutter state) {