Author: toad
Date: 2007-03-31 21:16:39 +0000 (Sat, 31 Mar 2007)
New Revision: 12494

Modified:
   trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java
Log:
Fix splitfile inserts:
- Don't call SplitFileInserter.encodedSegment twice when resuming. Unknown 
consequences.
- Don't schedule each check block twice. Known to cause "Completed twice" 
messages and insert failures via double-frees of DelayedFreeBuckets. Also would 
halve insert speed. Only relevant since nextgens' changes to FEC encoding.

Modified: trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java        
2007-03-31 20:17:09 UTC (rev 12493)
+++ trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java        
2007-03-31 21:16:39 UTC (rev 12494)
@@ -440,7 +440,6 @@
                                        parent.parent.completedBlock(true);
                        }
                        onEncodedSegment();
-                       parent.encodedSegment(this);
                }
                if (hasURIs) {
                        parent.segmentHasURIs(this);
@@ -465,6 +464,7 @@
                try {
                        for (int i = 0; i < checkBlockInserters.length; i++) {
                                if(checkBlocks[i] == null) continue;
+                               if(checkBlockInserters[i] != null) continue;
                                checkBlockInserters[i] = new 
SingleBlockInserter(parent.parent,
                                                checkBlocks[i], (short) -1, 
FreenetURI.EMPTY_CHK_URI,
                                                blockInsertContext, this, 
false, CHKBlock.DATA_LENGTH,
@@ -477,6 +477,7 @@
                        InserterException ex = new InserterException(
                                        InserterException.INTERNAL_ERROR, t, 
null);
                        finish(ex);
+                       return;
                }

                synchronized (this) {


Reply via email to