Author: toad
Date: 2008-04-08 14:19:00 +0000 (Tue, 08 Apr 2008)
New Revision: 19072

Modified:
   trunk/freenet/src/freenet/client/FECCodec.java
Log:
Increase redundancy from 128 -> 192 to 128 -> 255.
This will increase the cost of an upload by 33%, but inserts are pretty fast 
right now.
We expect it to increase reliability significantly. Redundancy at the FEC level 
is far more efficient than redundancy at the simple block duplication level.

Modified: trunk/freenet/src/freenet/client/FECCodec.java
===================================================================
--- trunk/freenet/src/freenet/client/FECCodec.java      2008-04-08 11:17:40 UTC 
(rev 19071)
+++ trunk/freenet/src/freenet/client/FECCodec.java      2008-04-08 14:19:00 UTC 
(rev 19072)
@@ -65,9 +65,8 @@
                if(splitfileType == Metadata.SPLITFILE_NONREDUNDANT)
                        return null;
                if(splitfileType == Metadata.SPLITFILE_ONION_STANDARD) {
-                       int checkBlocks = (dataBlocks >> 1);
-                       if((dataBlocks & 1) == 1)
-                               checkBlocks++;
+                       int checkBlocks = dataBlocks;
+                       if(dataBlocks == 128) checkBlocks--; // Stay within the 
8-bit code range, speeds things up 4x
                        return StandardOnionFECCodec.getInstance(dataBlocks, 
checkBlocks, executor);
                }
                else


Reply via email to