Author: toad
Date: 2008-06-28 17:24:07 +0000 (Sat, 28 Jun 2008)
New Revision: 20849

Modified:
   branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java
Log:
Logging... something wierd is happening...

Modified: branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java        
2008-06-28 14:50:58 UTC (rev 20848)
+++ branches/db4o/freenet/src/freenet/client/async/SplitFileFetcher.java        
2008-06-28 17:24:07 UTC (rev 20849)
@@ -179,6 +179,7 @@
         * @throws FetchException If the fetch failed for some reason.
         */
        private Bucket finalStatus(ObjectContainer container, ClientContext 
context) throws FetchException {
+               boolean logMINOR = Logger.shouldLog(Logger.MINOR, this);
                long finalLength = 0;
                for(int i=0;i<segments.length;i++) {
                        SplitFileFetcherSegment s = segments[i];
@@ -190,6 +191,8 @@
                        s.throwError();
                        // If still here, it succeeded
                        finalLength += s.decodedLength();
+                       if(logMINOR)
+                               Logger.minor(this, "Segment "+i+" decoded 
length "+s.decodedLength()+" total length now "+finalLength);
                        // Healing is done by Segment
                }
                if(finalLength > overrideLength) {
@@ -231,6 +234,9 @@
                                }
                        }
                }
+               if(finalLength != output.size()) {
+                       Logger.error(this, "Final length is supposed to be 
"+finalLength+" but only written "+output.size());
+               }
                return output;
        }



Reply via email to