Author: toad
Date: 2008-01-18 12:58:32 +0000 (Fri, 18 Jan 2008)
New Revision: 17131

Modified:
   trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
Log:
Fix the >2GB insert failure bug. Maybe.

Modified: 
trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java  
2008-01-18 12:47:36 UTC (rev 17130)
+++ trunk/freenet/src/freenet/support/io/PaddedEphemerallyEncryptedBucket.java  
2008-01-18 12:58:32 UTC (rev 17131)
@@ -54,6 +54,7 @@
                this.minPaddedSize = minSize;
                readOnly = false;
                lastOutputStream = 0;
+               dataLength = 0;
        }

        /**
@@ -224,7 +225,7 @@
                }

                public final int available() {
-                       int x = (int)(dataLength - ptr);
+                       int x = (int)Math.min(dataLength - ptr, 
Integer.MAX_VALUE);
                        return (x < 0) ? 0 : x;
                }



Reply via email to