Author: xor
Date: 2008-11-15 22:16:08 +0000 (Sat, 15 Nov 2008)
New Revision: 23611

Modified:
   trunk/plugins/WoT/IdentityFetcher.java
Log:
Fetch the next edition of an identity even if parsing fails. This allows people 
to fix their identity.xml if they inserted a broken one.

Modified: trunk/plugins/WoT/IdentityFetcher.java
===================================================================
--- trunk/plugins/WoT/IdentityFetcher.java      2008-11-15 22:15:34 UTC (rev 
23610)
+++ trunk/plugins/WoT/IdentityFetcher.java      2008-11-15 22:16:08 UTC (rev 
23611)
@@ -149,15 +149,21 @@
         */
        public synchronized void onSuccess(FetchResult result, ClientGetter 
state) {
                
-               Logger.debug(this, "Fetched key (ClientGetter) : " + 
state.getURI());
-
+               Logger.debug(this, "Fetched identity "+ 
state.getURI().toString());
+               
                try {
-                       Logger.debug(this, "Sucessfully fetched identity "+ 
state.getURI().toString());                 
                        new IdentityParser(db, client, 
this).parse(result.asBucket().getInputStream(), state.getURI()); 
-                       
state.restart(state.getURI().setSuggestedEdition(state.getURI().getSuggestedEdition()
 + 1));
-               } catch (Exception e) {
+               }
+               catch (Exception e) {
                        Logger.error(this, "Parsing failed for "+ 
state.getURI(), e);
                }
+               
+               try {
+                       
state.restart(state.getURI().setSuggestedEdition(state.getURI().getSuggestedEdition()
 + 1));
+               }
+               catch(Exception e) {
+                       Logger.error(this, "Error fetching next edition for " + 
state.getURI());
+               }
        }
        
        private synchronized void removeIdentity(ClientGetter state) {

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

Reply via email to