Author: toad
Date: 2009-02-17 23:15:14 +0000 (Tue, 17 Feb 2009)
New Revision: 25674

Modified:
   branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java
Log:
Remove messages from database when setting a new one and when removing the 
request


Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java   2009-02-17 
23:13:58 UTC (rev 25673)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientGet.java   2009-02-17 
23:15:14 UTC (rev 25674)
@@ -489,9 +489,12 @@
 
        private void trySendProgress(SimpleProgressMessage msg, 
FCPConnectionOutputHandler handler, ObjectContainer container) {
                if(persistenceType != ClientRequest.PERSIST_CONNECTION) {
+                       FCPMessage oldProgress = progressPending;
                        progressPending = msg;
-                       if(persistenceType == ClientRequest.PERSIST_FOREVER)
+                       if(persistenceType == ClientRequest.PERSIST_FOREVER) {
                                container.store(this);
+                               if(oldProgress != null) 
oldProgress.removeFrom(container);
+                       }
                }
                if(persistenceType == PERSIST_FOREVER)
                        container.activate(client, 1);
@@ -620,6 +623,10 @@
                                container.activate(allDataPending, 5);
                                allDataPending.removeFrom(container);
                        }
+                       if(progressPending != null) {
+                               container.activate(progressPending, 5);
+                               progressPending.removeFrom(container);
+                       }
                }
                super.requestWasRemoved(container);
        }

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

Reply via email to