Author: toad
Date: 2008-06-26 14:52:36 +0000 (Thu, 26 Jun 2008)
New Revision: 20742

Modified:
   branches/db4o/freenet/src/freenet/client/async/ClientGetter.java
Log:
Deactivate after scheduling here too.

Modified: branches/db4o/freenet/src/freenet/client/async/ClientGetter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientGetter.java    
2008-06-26 14:50:46 UTC (rev 20741)
+++ branches/db4o/freenet/src/freenet/client/async/ClientGetter.java    
2008-06-26 14:52:36 UTC (rev 20742)
@@ -119,8 +119,10 @@
                } catch (MalformedURLException e) {
                        throw new FetchException(FetchException.INVALID_URI, e);
                }
-               if(persistent())
+               if(persistent()) {
                        container.set(this);
+                       container.deactivate(currentState, 1);
+               }
                return true;
        }

@@ -145,6 +147,8 @@
                                        Logger.minor(this, "Copying - 
returnBucket not respected by client.async");
                                BucketTools.copy(from, to);
                                from.free();
+                               if(persistent())
+                                       from.removeFrom(container);
                        } catch (IOException e) {
                                Logger.error(this, "Error copying from "+from+" 
to "+to+" : "+e.toString(), e);
                                onFailure(new 
FetchException(FetchException.BUCKET_ERROR, e.toString()), state /* not 
strictly to blame, but we're not ako ClientGetState... */, container, context);
@@ -212,6 +216,8 @@
                }
                if(s != null) {
                        if(logMINOR) Logger.minor(this, "Cancelling 
"+currentState);
+                       if(persistent())
+                               container.activate(s, 1);
                        s.cancel(container, context);
                }
        }


Reply via email to