Author: toad
Date: 2008-01-31 17:19:39 +0000 (Thu, 31 Jan 2008)
New Revision: 17424

Modified:
   trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
Log:
Use the stats from the submessage on RejectedOverload also.

Modified: trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
===================================================================
--- trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java  
2008-01-31 14:44:12 UTC (rev 17423)
+++ trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java  
2008-01-31 17:19:39 UTC (rev 17424)
@@ -318,6 +318,14 @@
                                        // Non-fatal - probably still have time 
left
                                        forwardRejectedOverload();
                                        rejectOverloads++;
+                                       // Count the nodes involved for results 
purposes.
+                                       // Don't use the HTL or nearestLoc.
+                       Message sub = 
msg.getSubMessage(DMT.FNPRHReturnSubMessage);
+                       double newBest = sub.getDouble(DMT.BEST_LOCATION);
+                       if(Location.distance(newBest, target) < 
Location.distance(best, target))
+                               best = newBest;
+                       counter += Math.max(0, msg.getShort(DMT.COUNTER));
+                       uniqueCounter += Math.max(0, 
msg.getShort(DMT.UNIQUE_COUNTER));
                                        if (msg.getBoolean(DMT.IS_LOCAL)) {
                                                //NB: IS_LOCAL means it's 
terminal. not(IS_LOCAL) implies that the rejection message was forwarded from a 
downstream node.
                                                //"Local" from our peers 
perspective, this has nothing to do with local requests (source==null)


Reply via email to