Author: toad
Date: 2007-06-21 17:53:01 +0000 (Thu, 21 Jun 2007)
New Revision: 13691
Modified:
trunk/freenet/src/freenet/node/NodeDispatcher.java
Log:
Reject it if we have to
Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-06-21 17:39:25 UTC
(rev 13690)
+++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-06-21 17:53:01 UTC
(rev 13691)
@@ -504,7 +504,7 @@
for(int i=0;i<locsNotVisited.length;i++)
notVisitedList.add(new
Double(locsNotVisited[i]));
}
- innerHandleProbeRequest(src, id, lid, target, best, nearest,
htl, counter, true, true, false, null, notVisitedList, 2.0);
+ innerHandleProbeRequest(src, id, lid, target, best, nearest,
htl, counter, true, false, null, notVisitedList, 2.0);
return true;
}
@@ -522,14 +522,13 @@
* @param htl
* @param counter
* @param checkRecent
- * @param canReject
* @param cb
* @param locsNotVisited
* @param maxDistance
* @return
*/
private void innerHandleProbeRequest(PeerNode src, long id, Long lid,
final double target, double best,
- double nearest, short htl, short counter, boolean
checkRecent, boolean canReject,
+ double nearest, short htl, short counter, boolean
checkRecent,
boolean fromRejection, ProbeCallback cb, Vector
locsNotVisited, double maxDistance) {
if(fromRejection) {
nearest = furthestLoc(target);
@@ -694,7 +693,7 @@
if(pn == null) {
// Can't complete, because some HTL left
// Reject: RNF
- if(canReject) {
+ if(src != null) {
Message reject =
DMT.createFNPProbeRejected(id, target, nearest, best, counter, htl,
DMT.PROBE_REJECTED_RNF);
reject.addSubMessage(sub);
try {
@@ -810,7 +809,7 @@
furthestDist = dist;
}
}
- innerHandleProbeRequest(src, id, lid, target,
best, nearest, ctx.htl, counter, false, false, false, null, notVisitedList,
furthestDist);
+ innerHandleProbeRequest(src, id, lid, target,
best, nearest, ctx.htl, counter, false, false, null, notVisitedList,
furthestDist);
return true;
}
}
@@ -908,7 +907,7 @@
for(int i=0;i<locsNotVisited.length;i++)
notVisitedList.add(new
Double(locsNotVisited[i]));
}
- innerHandleProbeRequest(src, id, lid, target, best, nearest,
htl, counter, false, false, true, null, notVisitedList, 2.0);
+ innerHandleProbeRequest(src, id, lid, target, best, nearest,
htl, counter, false, true, null, notVisitedList, 2.0);
return true;
}
@@ -919,7 +918,7 @@
recentProbeRequestIDs.push(ll);
}
double nodeLoc = node.getLocation();
- innerHandleProbeRequest(null, l, ll, d, (nodeLoc > d) ? nodeLoc
: furthestGreater(d), nodeLoc, node.maxHTL(), (short)0, false, false, false,
cb, new Vector(), 2.0);
+ innerHandleProbeRequest(null, l, ll, d, (nodeLoc > d) ? nodeLoc
: furthestGreater(d), nodeLoc, node.maxHTL(), (short)0, false, false, cb, new
Vector(), 2.0);
}
private double furthestLoc(double d) {