r26622 - in trunk/freenet/src/freenet/client: . async

[email protected]
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-07 22:11:23 +0000 (Tue, 07 Apr 2009)
New Revision: 26622

Modified:
   trunk/freenet/src/freenet/client/InsertBlock.java
   trunk/freenet/src/freenet/client/async/SingleFileInserter.java
Log:
Store in free()


Modified: trunk/freenet/src/freenet/client/InsertBlock.java
===================================================================
--- trunk/freenet/src/freenet/client/InsertBlock.java	2009-04-07 22:10:24 UTC (rev 26621)
+++ trunk/freenet/src/freenet/client/InsertBlock.java	2009-04-07 22:11:23 UTC (rev 26622)
@@ -44,6 +44,8 @@
 			data.removeFrom(container);
 			data = null; // don't remove twice
 		}
+		if(container != null)
+			container.store(this);
 	}
 	
 	public void removeFrom(ObjectContainer container) {

Modified: trunk/freenet/src/freenet/client/async/SingleFileInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileInserter.java	2009-04-07 22:10:24 UTC (rev 26621)
+++ trunk/freenet/src/freenet/client/async/SingleFileInserter.java	2009-04-07 22:11:23 UTC (rev 26622)
@@ -623,11 +623,9 @@
 				if(splitInsertSuccess && metaInsertSuccess) {
 					if(logMINOR) Logger.minor(this, "Both succeeded for "+this);
 					finished = true;
-					if(freeData) {
+					if(freeData)
 						block.free(container);
-						if(persistent)
-							container.store(this);
-					} else {
+					else {
 						block.nullData();
 						if(persistent)
 							container.store(block);
@@ -807,10 +805,11 @@
 			synchronized(this) {
 				if(freeData)
 					block.free(container);
-				else
+				else {
 					block.nullData();
-				if(persistent)
-					container.store(block);
+					if(persistent)
+						container.store(block);
+				}
 			}
 			cb.onFailure(e, this, container, context);
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.