Author: toad
Date: 2006-01-27 21:35:46 +0000 (Fri, 27 Jan 2006)
New Revision: 7959

Modified:
   trunk/freenet/src/freenet/client/FetcherContext.java
   trunk/freenet/src/freenet/client/InserterContext.java
   trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java
   trunk/freenet/src/freenet/node/Version.java
   trunk/freenet/src/freenet/node/fcp/ClientGet.java
Log:
410:
More minor bugfixes:
- Remove cancel from FetchContext/InserterContext.
- Make FCP cancel work.
- Don't process post-termination notifications at all in segment fetcher.

Modified: trunk/freenet/src/freenet/client/FetcherContext.java
===================================================================
--- trunk/freenet/src/freenet/client/FetcherContext.java        2006-01-27 
21:23:40 UTC (rev 7958)
+++ trunk/freenet/src/freenet/client/FetcherContext.java        2006-01-27 
21:35:46 UTC (rev 7959)
@@ -36,15 +36,10 @@
        public int maxDataBlocksPerSegment;
        public int maxCheckBlocksPerSegment;
        public boolean cacheLocalRequests;
-       private boolean cancelled;
        /** If true, and we get a ZIP manifest, and we have no meta-strings 
left, then
         * return the manifest contents as data. */
        public boolean returnZIPManifests;

-       public final boolean isCancelled() {
-               return cancelled;
-       }
-       
        public FetcherContext(long curMaxLength, 
                        long curMaxTempLength, int maxMetadataSize, int 
maxRecursionLevel, int maxArchiveRestarts,
                        boolean dontEnterImplicitArchives, int 
maxSplitfileThreads,
@@ -190,10 +185,6 @@
                else throw new IllegalArgumentException();
        }

-       public void cancel() {
-               this.cancelled = true;
-       }
-       
        /** Make public, but just call parent for a field for field copy */
        public Object clone() {
                try {

Modified: trunk/freenet/src/freenet/client/InserterContext.java
===================================================================
--- trunk/freenet/src/freenet/client/InserterContext.java       2006-01-27 
21:23:40 UTC (rev 7958)
+++ trunk/freenet/src/freenet/client/InserterContext.java       2006-01-27 
21:35:46 UTC (rev 7959)
@@ -21,7 +21,6 @@
        public final ClientEventProducer eventProducer;
        /** Interesting tradeoff, see comments at top of Node.java. */
        public final boolean cacheLocalRequests;
-       private boolean cancelled;

        public InserterContext(BucketFactory bf, RandomSource random,
                        int maxRetries, int rnfsToSuccess, int maxThreads, int 
splitfileSegmentDataBlocks, int splitfileSegmentCheckBlocks,
@@ -67,12 +66,4 @@
                this.cacheLocalRequests = ctx.cacheLocalRequests;
        }

-       public void cancel() {
-               cancelled = true;
-       }
-
-       public boolean isCancelled() {
-               return cancelled;
-       }
-       
 }

Modified: trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java        
2006-01-27 21:23:40 UTC (rev 7958)
+++ trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java        
2006-01-27 21:35:46 UTC (rev 7959)
@@ -118,6 +118,7 @@
                SingleBlockInserter sbi = (SingleBlockInserter)state;
                int x = sbi.token;
                synchronized(this) {
+                       if(finished) return;
                        if(x >= dataBlocks.length) {
                                if(checkURIs[x-dataBlocks.length] != null) {
                                        Logger.normal(this, "Got uri twice for 
check block "+x+" on "+this);
@@ -166,6 +167,7 @@

        private boolean completed(int x) {
                synchronized(this) {
+                       if(finished) return true;
                        if(x >= dataBlocks.length) {
                                if(checkBlockInserters[x-dataBlocks.length] == 
null) {
                                        Logger.error(this, "Completed twice: 
check block "+x+" on "+this);

Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-01-27 21:23:40 UTC (rev 
7958)
+++ trunk/freenet/src/freenet/node/Version.java 2006-01-27 21:35:46 UTC (rev 
7959)
@@ -20,7 +20,7 @@
        public static final String protocolVersion = "1.0";

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

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

Modified: trunk/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientGet.java   2006-01-27 21:23:40 UTC 
(rev 7958)
+++ trunk/freenet/src/freenet/node/fcp/ClientGet.java   2006-01-27 21:35:46 UTC 
(rev 7959)
@@ -63,7 +63,7 @@
        }

        public void cancel() {
-               fctx.cancel();
+               getter.cancel();
        }

        public void onSuccess(FetchResult result, ClientGetter state) {


Reply via email to