Author: toad
Date: 2009-04-10 14:55:35 +0000 (Fri, 10 Apr 2009)
New Revision: 26712
Modified:
trunk/freenet/src/freenet/client/async/ClientGetState.java
trunk/freenet/src/freenet/client/async/SimpleSingleFileFetcher.java
Log:
Call the onFailure, and document why in ClientGetState interface
Modified: trunk/freenet/src/freenet/client/async/ClientGetState.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientGetState.java 2009-04-10
14:52:07 UTC (rev 26711)
+++ trunk/freenet/src/freenet/client/async/ClientGetState.java 2009-04-10
14:55:35 UTC (rev 26712)
@@ -13,6 +13,9 @@
public void schedule(ObjectContainer container, ClientContext context)
throws KeyListenerConstructionException;
+ /** Cancel the request, and call onFailure() on the callback in order
to tell
+ * downstream (ultimately the client) that cancel has succeeded, and to
allow
+ * it to call removeFrom() to avoid a database leak. */
public void cancel(ObjectContainer container, ClientContext context);
public long getToken();
Modified: trunk/freenet/src/freenet/client/async/SimpleSingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SimpleSingleFileFetcher.java
2009-04-10 14:52:07 UTC (rev 26711)
+++ trunk/freenet/src/freenet/client/async/SimpleSingleFileFetcher.java
2009-04-10 14:55:35 UTC (rev 26712)
@@ -182,5 +182,11 @@
super.removeFrom(container, context);
// rcb is definitely not our responsibility.
}
-
+
+ public void cancel(ObjectContainer container, ClientContext context) {
+ super.cancel(container, context);
+ if(persistent) container.activate(rcb, 1);
+ rcb.onFailure(new FetchException(FetchException.CANCELLED),
this, container, context);
+ }
+
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs