r26649 - trunk/freenet/src/freenet/client/async

[email protected]
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-08 13:37:06 +0000 (Wed, 08 Apr 2009)
New Revision: 26649

Modified:
   trunk/freenet/src/freenet/client/async/USKFetcher.java
Log:
Don't re-run USK fetcher immediately if we have only confirmed our suspicions and not actually advanced.


Modified: trunk/freenet/src/freenet/client/async/USKFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/USKFetcher.java	2009-04-08 13:06:26 UTC (rev 26648)
+++ trunk/freenet/src/freenet/client/async/USKFetcher.java	2009-04-08 13:37:06 UTC (rev 26649)
@@ -279,11 +279,14 @@
 				sleepTime = newSleepTime;
 				end = now + context.random.nextInt(sleepTime);
                 
-				if(valAtEnd > valueAtSchedule) {
+				if(valAtEnd > valueAtSchedule && valAtEnd > origUSK.suggestedEdition) {
 					// We have advanced; keep trying as if we just started.
+					// Only if we actually DO advance, not if we just confirm our suspicion (valueAtSchedule always starts at 0).
 					minFailures = origMinFailures;
 					sleepTime = origSleepTime;
 					end = now;
+					if(logMINOR)
+						Logger.minor(this, "We have advanced: at start, "+valueAtSchedule+" at end, "+valAtEnd);
 				} else {
 					// We have not found any new version; Increase exponentially but relatively slowly
 					long newMinFailures = Math.max(((int)(minFailures * 1.25)), minFailures+1);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.