Author: toad
Date: 2006-01-27 20:09:48 +0000 (Fri, 27 Jan 2006)
New Revision: 7953

Modified:
   trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
   trunk/freenet/src/freenet/client/events/SplitfileProgressEvent.java
   trunk/freenet/src/freenet/node/Node.java
   trunk/freenet/src/freenet/node/Version.java
Log:
404:
Fix some more bugs.

Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java       
2006-01-27 19:24:20 UTC (rev 7952)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java       
2006-01-27 20:09:48 UTC (rev 7953)
@@ -75,7 +75,7 @@
                this.actx = actx;
                this.recursionLevel = recursionLevel + 1;
                if(recursionLevel > ctx.maxRecursionLevel)
-                       throw new 
FetchException(FetchException.TOO_MUCH_RECURSION);
+                       throw new 
FetchException(FetchException.TOO_MUCH_RECURSION, "Too much recursion: 
"+recursionLevel+" > "+ctx.maxRecursionLevel);
                this.decompressors = new LinkedList();
                parent.addBlock();
                if(isEssential)
@@ -278,7 +278,7 @@
                        } else if(metadata.isMultiLevelMetadata()) {
                                // Fetch on a second SingleFileFetcher, like 
with archives.
                                Metadata newMeta = (Metadata) metadata.clone();
-                               metadata.setSimpleRedirect();
+                               newMeta.setSimpleRedirect();
                                SingleFileFetcher f = new 
SingleFileFetcher(this, newMeta, new MultiLevelMetadataCallback(), ctx);
                                f.handleMetadata();
                                return;

Modified: trunk/freenet/src/freenet/client/events/SplitfileProgressEvent.java
===================================================================
--- trunk/freenet/src/freenet/client/events/SplitfileProgressEvent.java 
2006-01-27 19:24:20 UTC (rev 7952)
+++ trunk/freenet/src/freenet/client/events/SplitfileProgressEvent.java 
2006-01-27 20:09:48 UTC (rev 7953)
@@ -20,7 +20,7 @@
        }

        public String getDescription() {
-               return "Completed 
"+(100*(fetchedBlocks+failedBlocks+fatallyFailedBlocks)/minSuccessfulBlocks)+"% 
"+fetchedBlocks+"/"+totalBlocks+" (failed "+failedBlocks+", fatally 
"+fatallyFailedBlocks+", need "+minSuccessfulBlocks+", total "+totalBlocks+")";
+               return "Completed 
"+(100*(fetchedBlocks)/minSuccessfulBlocks)+"% 
"+fetchedBlocks+"/"+totalBlocks+" (failed "+failedBlocks+", fatally 
"+fatallyFailedBlocks+", need "+minSuccessfulBlocks+", total "+totalBlocks+")";
        }

        public int getCode() {

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2006-01-27 19:24:20 UTC (rev 
7952)
+++ trunk/freenet/src/freenet/node/Node.java    2006-01-27 20:09:48 UTC (rev 
7953)
@@ -991,7 +991,7 @@
                        DSAPublicKey pubKey = k.getPubKey();
                        if(pubKey == null) {
                                pubKey = getKey(k.getPubKeyHash());
-                               Logger.minor(this, "Got pubkey: "+pubKey+" 
"+(pubKey == null ? "" : pubKey.writeAsField()));
+                               Logger.minor(this, "Fetched pubkey: "+pubKey+" 
"+(pubKey == null ? "" : pubKey.writeAsField()));
                                try {
                                                k.setPubKey(pubKey);
                                        } catch (SSKVerifyException e) {
@@ -1478,11 +1478,18 @@
        }

        private ClientKeyBlock fetch(ClientSSK clientSSK) throws 
SSKVerifyException {
-               DSAPublicKey key = getKey(clientSSK.pubKeyHash);
+               DSAPublicKey key = clientSSK.getPubKey();
+               boolean hadKey = key != null;
+               if(key == null) {
+                       key = getKey(clientSSK.pubKeyHash);
+               }
                if(key == null) return null;
                clientSSK.setPublicKey(key);
                SSKBlock block = fetch((NodeSSK)clientSSK.getNodeKey());
                if(block == null) return null;
+               // Move the pubkey to the top of the LRU, and fix it if it
+               // was corrupt.
+               cacheKey(clientSSK.pubKeyHash, key);
                return new ClientSSKBlock(block, clientSSK);
        }


Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-01-27 19:24:20 UTC (rev 
7952)
+++ trunk/freenet/src/freenet/node/Version.java 2006-01-27 20:09:48 UTC (rev 
7953)
@@ -20,7 +20,7 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       public static final int buildNumber = 403;
+       public static final int buildNumber = 404;

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


Reply via email to