-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

batosai at freenetproject.org a ?crit :
> Author: batosai
> Date: 2008-08-05 17:44:42 +0000 (Tue, 05 Aug 2008)
> New Revision: 21622
> 
> Modified:
>    trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
> Log:
> First try with non-blocking requests.
> 
> Modified: trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
> ===================================================================
> --- trunk/apps/WoT/src/plugins/WoT/WoTplugin.java     2008-08-05 17:25:22 UTC 
> (rev 21621)
> +++ trunk/apps/WoT/src/plugins/WoT/WoTplugin.java     2008-08-05 17:44:42 UTC 
> (rev 21622)
> @@ -13,7 +13,10 @@
>  import com.db4o.ObjectContainer;
>  import com.db4o.ObjectSet;
>  
> +import freenet.client.FetchContext;
> +import freenet.client.FetchException;
>  import freenet.client.HighLevelSimpleClient;
> +import freenet.client.async.ClientCallback;
>  import freenet.clients.http.PageMaker;
>  import freenet.config.Config;
>  import freenet.config.SubConfig;
> @@ -116,6 +119,24 @@
>                       }
>                       return makeOwnIdentitiesPage();
>               }
> +             else if(page.equals("/addIdentity")) {
> +                     try {
> +                             FreenetURI identity = new 
> FreenetURI(request.getPartAsString("identityURI", 1024));
> +                             
> +                             FetchContext fetchContext = 
> client.getFetchContext();
> +                             fetchContext.maxSplitfileBlockRetries = -1; // 
> retry forever
> +                             fetchContext.maxNonSplitfileRetries = -1; // 
> retry forever
> +                             client.fetch(identity, -1, this, 
> fetchedTrustList(), fetchContext);

I guess that -1 maxsize means 'no maxsize', but I'm less comfortable
with the callback function. Help would be much appreciated.

> +                             return makeKnownIdentitiesPage();
> +                     }
> +                     catch(MalformedURLException e) {
> +                             return e.getLocalizedMessage();
> +                     } 
> +                     catch (FetchException e) {
> +                             return e.toString();
> +                     }
> +             }
>               else {
>                       return makeHomePage();
>               }
> @@ -257,5 +278,10 @@
>       public String getVersion() {
>               return "0.1 r"+Version.getSvnRevision();
>       }
> +     
> +     private ClientCallback fetchedTrustList() {
> +             // TODO Auto-generated method stub
> +             return null;
> +     }

Eclipse suggested this. That's nice, but where is the fetched key ?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFImJIzmY5qNqKdYw0RAivRAJ9eHe8RSzzSgyI1HP3gVuKoKnQtWgCeOuAw
lHSwHa2mWsF4GO8lnhUd3Hs=
=yeus
-----END PGP SIGNATURE-----

Reply via email to