Author: toad
Date: 2007-11-28 16:02:19 +0000 (Wed, 28 Nov 2007)
New Revision: 16026
Modified:
trunk/freenet/src/freenet/node/CHKInsertSender.java
Log:
Don't hang on RECEIVE_FAILED!
Modified: trunk/freenet/src/freenet/node/CHKInsertSender.java
===================================================================
--- trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-11-28 15:50:02 UTC
(rev 16025)
+++ trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-11-28 16:02:19 UTC
(rev 16026)
@@ -612,6 +612,7 @@
// when we notice that receiveFailed = true.
synchronized(this) {
status = RECEIVE_FAILED;
+ allTransfersCompleted = true;
notifyAll();
}
// Do not call finish(), that can only be called on the main thread and
it will block.
@@ -684,6 +685,9 @@
while(true) {
+ synchronized(nodesWaitingForCompletion) {
+ if(receiveFailed) return;
+ }
// First calculate the timeout
int timeout;
long now = System.currentTimeMillis();
@@ -784,6 +788,7 @@
if(noneRouteable) return false;
synchronized(nodesWaitingForCompletion) {
+ if(receiveFailed) return false;
if(logMINOR) Logger.minor(this,
"Waiting for completion");
try {
nodesWaitingForCompletion.wait(100*1000);