Author: toad
Date: 2008-05-21 12:18:06 +0000 (Wed, 21 May 2008)
New Revision: 20007
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
Log:
And reregisterAll.
removeFirst() needs to remain in Core, because we need to juggle between self
and non-persistent...
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
2008-05-21 12:16:57 UTC (rev 20006)
+++
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
2008-05-21 12:18:06 UTC (rev 20007)
@@ -266,5 +266,22 @@
return Math.max(0, retryCount-MIN_RETRY_COUNT);
}
+ public void reregisterAll(ClientRequester request, RandomSource random)
{
+ SendableRequest[] reqs;
+ synchronized(this) {
+ HashSet h = (HashSet)
allRequestsByClientRequest.get(request);
+ if(h == null) return;
+ reqs = (SendableRequest[]) h.toArray(new
SendableRequest[h.size()]);
+ }
+
+ for(int i=0;i<reqs.length;i++) {
+ SendableRequest req = reqs[i];
+ // Unregister from the RGA's, but keep the pendingKeys
and cooldown queue data.
+ req.unregister(true);
+ // Then can do innerRegister() (not register()).
+ innerRegister(req, random);
+ }
+ }
+
}
Modified:
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
===================================================================
---
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
2008-05-21 12:16:57 UTC (rev 20006)
+++
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
2008-05-21 12:18:06 UTC (rev 20007)
@@ -231,23 +231,6 @@
return null;
}
- public void reregisterAll(ClientRequester request, RandomSource random)
{
- SendableRequest[] reqs;
- synchronized(this) {
- HashSet h = (HashSet)
allRequestsByClientRequest.get(request);
- if(h == null) return;
- reqs = (SendableRequest[]) h.toArray(new
SendableRequest[h.size()]);
- }
-
- for(int i=0;i<reqs.length;i++) {
- SendableRequest req = reqs[i];
- // Unregister from the RGA's, but keep the pendingKeys
and cooldown queue data.
- req.unregister(true);
- // Then can do innerRegister() (not register()).
- innerRegister(req, random);
- }
- }
-
private static final short[] tweakedPrioritySelector = {
RequestStarter.MAXIMUM_PRIORITY_CLASS,
RequestStarter.MAXIMUM_PRIORITY_CLASS,