Author: toad
Date: 2008-01-18 12:35:52 +0000 (Fri, 18 Jan 2008)
New Revision: 17128

Modified:
   trunk/freenet/src/freenet/client/async/SplitFileInserter.java
Log:
Get the length before we free the data

Modified: trunk/freenet/src/freenet/client/async/SplitFileInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileInserter.java       
2008-01-18 12:24:43 UTC (rev 17127)
+++ trunk/freenet/src/freenet/client/async/SplitFileInserter.java       
2008-01-18 12:35:52 UTC (rev 17128)
@@ -84,6 +84,7 @@
                } catch (IOException e) {
                        throw new InsertException(InsertException.BUCKET_ERROR, 
e, null);
                }
+               this.dataLength = data.size();
                if(freeData) data.free();
                countDataBlocks = dataBuckets.length;
                // Encoding is done by segments
@@ -92,7 +93,6 @@
                else
                        compressionCodec = bestCodec.codecNumberForMetadata();
                this.splitfileAlgorithm = ctx.splitfileAlgorithm;
-               this.dataLength = data.size();
                segmentSize = ctx.splitfileSegmentDataBlocks;
                checkSegmentSize = splitfileAlgorithm == 
Metadata.SPLITFILE_NONREDUNDANT ? 0 : ctx.splitfileSegmentCheckBlocks;



Reply via email to