Author: toad
Date: 2008-08-29 21:23:35 +0000 (Fri, 29 Aug 2008)
New Revision: 22217

Modified:
   branches/db4o/freenet/src/freenet/node/Node.java
Log:
If find a key from the store when starting a request, tripPendingKey() on it.


Modified: branches/db4o/freenet/src/freenet/node/Node.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/Node.java    2008-08-29 21:22:10 UTC 
(rev 22216)
+++ branches/db4o/freenet/src/freenet/node/Node.java    2008-08-29 21:23:35 UTC 
(rev 22217)
@@ -2072,7 +2072,13 @@
                                }
                        } else
                                throw new IllegalStateException("Unknown key 
type: "+key.getClass());
-                       if(chk != null) return chk;
+                       if(chk != null) {
+                               // Probably somebody waiting for it. Trip it.
+                               if(clientCore != null && 
clientCore.requestStarters != null)
+                                       
clientCore.requestStarters.chkFetchScheduler.tripPendingKey(chk);
+                               failureTable.onFound(chk);
+                               return chk;
+                       }
                }
                if(localOnly) return null;
                if(logMINOR) Logger.minor(this, "Not in store locally");


Reply via email to