Author: toad
Date: 2008-02-06 01:15:23 +0000 (Wed, 06 Feb 2008)
New Revision: 17584

Modified:
   trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
Log:
If no queued normal requests, look for an offered key.
This is important because RequestStarter *WILL SLEEP IF IT APPEARS TO HAVE 
NOTHING TO DO*!

Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-02-06 01:02:02 UTC (rev 17583)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-02-06 01:15:23 UTC (rev 17584)
@@ -382,6 +382,10 @@
                if(logMINOR) Logger.minor(this, "removeFirst()");
                boolean tryOfferedKeys = offeredKeys != null && 
node.random.nextBoolean();
                int choosenPriorityClass = 
removeFirstAccordingToPriorities(tryOfferedKeys);
+               if(choosenPriorityClass == -1 && !tryOfferedKeys) {
+                       tryOfferedKeys = true;
+                       choosenPriorityClass = 
removeFirstAccordingToPriorities(tryOfferedKeys);
+               }
                if(choosenPriorityClass == -1) {
                        if(logMINOR)
                                Logger.minor(this, "Nothing to do");


Reply via email to