Author: toad
Date: 2008-01-14 23:36:46 +0000 (Mon, 14 Jan 2008)
New Revision: 17047
Modified:
trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
trunk/freenet/src/freenet/node/SendableGet.java
Log:
Fix race condition causing Key <num> is null for ..SplitFileFetcherSubSegment
Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
2008-01-14 23:19:41 UTC (rev 17046)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
2008-01-14 23:36:46 UTC (rev 17047)
@@ -50,12 +50,12 @@
}
public int chooseKey() {
- if(segment.isFinishing()) return -1;
+ if(cancelled) return -1;
return removeRandomBlockNum();
}
public ClientKey getKey(int token) {
- if(segment.isFinishing()) {
+ if(cancelled) {
if(logMINOR)
Logger.minor(this, "Segment is finishing when
getting key "+token+" on "+this);
return null;
Modified: trunk/freenet/src/freenet/node/SendableGet.java
===================================================================
--- trunk/freenet/src/freenet/node/SendableGet.java 2008-01-14 23:19:41 UTC
(rev 17046)
+++ trunk/freenet/src/freenet/node/SendableGet.java 2008-01-14 23:36:46 UTC
(rev 17047)
@@ -125,5 +125,5 @@
public final void unregisterKey(Key key) {
getScheduler().removePendingKey(this, false, key);
}
-
+
}