Author: toad
Date: 2006-02-11 16:48:27 +0000 (Sat, 11 Feb 2006)
New Revision: 8012

Modified:
   trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
   trunk/freenet/src/freenet/node/Version.java
   trunk/freenet/src/freenet/support/SectoredRandomGrabArray.java
Log:
440:
Don't run finished/cancelled requests!
This should fix the "it keeps going after it's finished" bug.

Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java       
2006-02-10 21:07:08 UTC (rev 8011)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java       
2006-02-11 16:48:27 UTC (rev 8012)
@@ -20,7 +20,6 @@
 import freenet.keys.FreenetURI;
 import freenet.keys.KeyDecodeException;
 import freenet.node.LowLevelGetException;
-import freenet.node.LowLevelPutException;
 import freenet.node.Node;
 import freenet.support.Bucket;
 import freenet.support.Logger;
@@ -521,6 +520,10 @@

        /** Do the request, blocking. Called by RequestStarter. */
        public void send(Node node) {
+               if(cancelled) {
+                       onFailure(new FetchException(FetchException.CANCELLED), 
false);
+                       return;
+               }
                // Do we need to support the last 3?
                ClientKeyBlock block;
                try {

Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-02-10 21:07:08 UTC (rev 
8011)
+++ trunk/freenet/src/freenet/node/Version.java 2006-02-11 16:48:27 UTC (rev 
8012)
@@ -20,7 +20,7 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       private static final int buildNumber = 439;
+       private static final int buildNumber = 440;

        /** Oldest build of Fred we will talk to */
        private static final int lastGoodBuild = 403;

Modified: trunk/freenet/src/freenet/support/SectoredRandomGrabArray.java
===================================================================
--- trunk/freenet/src/freenet/support/SectoredRandomGrabArray.java      
2006-02-10 21:07:08 UTC (rev 8011)
+++ trunk/freenet/src/freenet/support/SectoredRandomGrabArray.java      
2006-02-11 16:48:27 UTC (rev 8012)
@@ -51,7 +51,9 @@
                                        System.arraycopy(grabArrays, x+1, 
newArray, x, grabArrays.length - (x+1));
                                grabArrays = newArray;
                        }
-                       if(item != null) return item;
+                       if(item == null) continue;
+                       if(item.isFinished()) continue;
+                       return item;
                }
        }



Reply via email to