r26933 - trunk/freenet/src/freenet/client/async
[email protected] Fri, 17 Apr 2009 11:45:11 +0000
| Newsgroups | gmane.network.freenet.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: j16sdiz
Date: 2009-04-17 11:45:10 +0000 (Fri, 17 Apr 2009)
New Revision: 26933
Modified:
trunk/freenet/src/freenet/client/async/InsertCompressor.java
Log:
Accept if we can fit in SSK (Do what the comment say)
Modified: trunk/freenet/src/freenet/client/async/InsertCompressor.java
===================================================================
--- trunk/freenet/src/freenet/client/async/InsertCompressor.java 2009-04-17 11:44:45 UTC (rev 26932)
+++ trunk/freenet/src/freenet/client/async/InsertCompressor.java 2009-04-17 11:45:10 UTC (rev 26933)
@@ -9,6 +9,7 @@
import freenet.client.InsertException;
import freenet.keys.CHKBlock;
import freenet.keys.NodeCHK;
+import freenet.keys.SSKBlock;
import freenet.node.PrioRunnable;
import freenet.support.Logger;
import freenet.support.api.Bucket;
@@ -148,7 +149,7 @@
if(resultSize < bestCompressedDataSize &&
// If compressing to CHK, origSize will always be greater
// If compressing to SSK, we are not interested unless we can get it small enough to fit in the SSK itself
- origSize > CHKBlock.DATA_LENGTH) {
+ (origSize > CHKBlock.DATA_LENGTH || resultSize <= SSKBlock.DATA_LENGTH)) {
if(logMINOR)
Logger.minor(this, "New size "+resultSize+" better than old best "+bestCompressedDataSize);
if(bestCompressedData != null && bestCompressedData != origData)