Author: toad
Date: 2008-07-22 15:59:06 +0000 (Tue, 22 Jul 2008)
New Revision: 21313

Modified:
   branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java
   
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
Log:
cloneKey() in maybeMakeChosenRequest, and only if persistent, not 
unconditionally in ChosenRequest constructor.

Modified: branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java   
2008-07-22 15:58:15 UTC (rev 21312)
+++ branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java   
2008-07-22 15:59:06 UTC (rev 21313)
@@ -35,14 +35,8 @@
        ChosenRequest(SendableRequest req, Object tok, Key key, ClientKey ckey, 
short prio) {
                request = req;
                token = tok;
-               if(key != null)
-                       this.key = key.cloneKey();
-               else
-                       this.key = null;
-               if(ckey != null)
-                       this.ckey = ckey.cloneKey();
-               else
-                       this.ckey = null;
+               this.key = key;
+               this.ckey = ckey;
                this.prio = prio;
                if(req instanceof SendableGet) {
                        SendableGet sg = (SendableGet) req;

Modified: 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java  
    2008-07-22 15:58:15 UTC (rev 21312)
+++ 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java  
    2008-07-22 15:59:06 UTC (rev 21313)
@@ -327,7 +327,8 @@
                                container.activate(req.getClientRequest(), 1);
                                if(key != null && key.getRoutingKey() == null)
                                        throw new NullPointerException();
-                               ret = new PersistentChosenRequest(this, req, 
token, key, ckey, req.getPriorityClass(container));
+                               ret = new PersistentChosenRequest(this, req, 
token, key == null ? null : key.cloneKey(), 
+                                               ckey == null ? null : 
ckey.cloneKey(), req.getPriorityClass(container));
                                container.set(ret);
                                if(logMINOR)
                                        Logger.minor(this, "Storing "+ret+" for 
"+req);


Reply via email to