Author: toad
Date: 2006-08-16 21:40:50 +0000 (Wed, 16 Aug 2006)
New Revision: 10139
Modified:
trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java
Log:
Fix surplus URIGenerated's.
Modified: trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
2006-08-16 21:22:56 UTC (rev 10138)
+++ trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
2006-08-16 21:40:50 UTC (rev 10139)
@@ -101,6 +101,7 @@
protected ClientKeyBlock encode() throws InserterException {
ClientKeyBlock block;
+ boolean shouldSend;
synchronized(this) {
if(refToClientKeyBlock != null) {
block = (ClientKeyBlock)
refToClientKeyBlock.get();
@@ -109,9 +110,10 @@
block = innerEncode();
refToClientKeyBlock =
new WeakReference(block);
+ shouldSend = (resultingURI == null);
resultingURI = block.getClientKey().getURI();
}
- if(!dontSendEncoded)
+ if(shouldSend && !dontSendEncoded)
cb.onEncode(block.getClientKey(), this);
return block;
}
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
2006-08-16 21:22:56 UTC (rev 10138)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
2006-08-16 21:40:50 UTC (rev 10139)
@@ -53,6 +53,7 @@
break;
}
}
+ Logger.minor(this, "Sending "+msg);
msg.send(os);
if(handler.isClosed()) return;
}
Modified: trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java 2006-08-16
21:22:56 UTC (rev 10138)
+++ trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java 2006-08-16
21:40:50 UTC (rev 10139)
@@ -2,6 +2,7 @@
import freenet.keys.FreenetURI;
import freenet.node.Node;
+import freenet.support.Logger;
import freenet.support.SimpleFieldSet;
public class URIGeneratedMessage extends FCPMessage {
@@ -10,6 +11,8 @@
private final String identifier;
public URIGeneratedMessage(FreenetURI uri, String identifier) {
+ // FIXME remove when debugged the
constant-stream-of-URIGenerated's bug.
+ Logger.minor(this, "URIGenerated created for "+uri+" on
"+identifier+" ("+this+")", new Exception("debug"));
this.uri = uri;
this.identifier = identifier;
}