Author: toad
Date: 2009-03-06 22:34:38 +0000 (Fri, 06 Mar 2009)
New Revision: 25912

Modified:
   branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
Log:
Don't send URIGenerated twice, don't store the new URI and leak the old one. 
Activate before remove.


Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java       
2009-03-06 22:33:31 UTC (rev 25911)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java       
2009-03-06 22:34:38 UTC (rev 25912)
@@ -169,9 +169,14 @@
 
        public void onGeneratedURI(FreenetURI uri, BaseClientPutter state, 
ObjectContainer container) {
                synchronized(this) {
-                       if((generatedURI != null) && !uri.equals(generatedURI))
-                               Logger.error(this, "onGeneratedURI("+uri+ ',' 
+state+") but already set generatedURI to "+generatedURI);
-                       generatedURI = uri;
+                       if(generatedURI != null) {
+                               if(!uri.equals(generatedURI))
+                                       Logger.error(this, 
"onGeneratedURI("+uri+ ',' +state+") but already set generatedURI to 
"+generatedURI);
+                               else
+                                       if(Logger.shouldLog(Logger.MINOR, 
this)) Logger.minor(this, "onGeneratedURI() twice with same value: 
"+generatedURI+" -> "+uri);
+                       } else {
+                               generatedURI = uri;
+                       }
                }
                if(persistenceType == PERSIST_FOREVER)
                        container.store(this);
@@ -208,16 +213,22 @@
                                progress = progressMessage;
                                progressMessage = null;
                        }
-                       if(pfm != null)
+                       if(pfm != null) {
+                               container.activate(pfm, 5);
                                pfm.removeFrom(container);
-                       if(uri != null)
+                       }
+                       if(uri != null) {
+                               container.activate(uri, 5);
                                uri.removeFrom(container);
+                       }
                        if(progress != null) {
                                container.activate(progress, 1);
                                progress.removeFrom(container);
                        }
+                       container.activate(publicURI, 5);
                        publicURI.removeFrom(container);
                }
+               super.requestWasRemoved(container);
        }
 
        public void receive(final ClientEvent ce, ObjectContainer container, 
ClientContext context) {

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to