Author: toad
Date: 2008-06-13 12:12:04 +0000 (Fri, 13 Jun 2008)
New Revision: 20284

Modified:
   branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
Log:
SingleBlockInserter: Encode in request selection, pass the encoded block as the 
chosen request object.

Modified: 
branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java     
2008-06-13 12:08:22 UTC (rev 20283)
+++ branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java     
2008-06-13 12:12:04 UTC (rev 20284)
@@ -296,7 +296,7 @@
                // Ignore keyNum, key, since we're only sending one block.
                try {
                        if(logMINOR) Logger.minor(this, "Starting request: 
"+this);
-                       ClientKeyBlock b = getBlock();
+                       ClientKeyBlock b = (ClientKeyBlock) keyNum;
                        if(b != null)
                                core.realPut(b, ctx.cacheLocalRequests);
                        else {
@@ -366,9 +366,9 @@
                return sendableKeys(container);
        }

-       public synchronized Object chooseKey(KeysFetchingLocally ignored, 
ObjectContainer container) {
-               if(finished) return null;
-               else return new Integer(0);
+       public synchronized Object chooseKey(KeysFetchingLocally ignored, 
ObjectContainer container, ClientContext context) {
+               // Ignore KeysFetchingLocally, it's for requests.
+               return getBlock(container, context);
        }

 }


Reply via email to