Author: jflesch
Date: 2007-08-16 00:32:25 +0000 (Thu, 16 Aug 2007)
New Revision: 14716

Modified:
   trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
Log:
Take into consideration the protocol errors when refreshing a board

Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java      2007-08-15 22:00:19 UTC 
(rev 14715)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java      2007-08-16 00:32:25 UTC 
(rev 14716)
@@ -61,10 +61,10 @@
        /* used when redirected */
        private boolean restartIfFailed = false;

+       private int protocolErrorCode = -1;
+       private int getFailedCode = -1;

-       private int getFailedCode = 0;

-
        /**
         * See setParameters().
         */
@@ -397,6 +397,11 @@
                if("ProtocolError".equals( message.getMessageName() )) {
                        Logger.debug(this, "ProtocolError !");

+                       if ("4".equals(message.getValue("Code"))) {
+                               Logger.warning(this, "The node reported an 
invalid key. Please check the following key\n"+
+                                              key);
+                       }
+
                        if("15".equals( message.getValue("Code") )) {
                                Logger.debug(this, "Unknow URI ? was probably a 
stop order so no problem ...");
                                return;
@@ -404,6 +409,8 @@

                        Logger.error(this, "=== PROTOCOL ERROR === 
\n"+message.toString());

+                       protocolErrorCode = 
Integer.parseInt(message.getValue("Code"));
+
                        status = "Protocol Error 
("+message.getValue("CodeDescription")+")";
                        progress = 100;
                        running = false;
@@ -1129,4 +1136,8 @@
        public int getGetFailedCode() {
                return getFailedCode;
        }
+
+       public int getProtocolErrorCode() {
+               return protocolErrorCode;
+       }
 }

Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java 
2007-08-15 22:00:19 UTC (rev 14715)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java 
2007-08-16 00:32:25 UTC (rev 14716)
@@ -97,9 +97,19 @@
                        return;

                if (!get.isSuccessful()) {
+
                        int code = get.getGetFailedCode();

-                       if (code == 13 /* dnd */
+                       if (get.getProtocolErrorCode() == 4
+                           || code == 20) {
+                               Logger.warning(this, "MiniFrost: Invalid key: 
"+key);
+                               successfullyDownloaded = true;
+                       } else if (get.getProtocolErrorCode() >= 0) {
+                               Logger.warning(this,
+                                              "MiniFrost: Unknown protocol 
error (code="+
+                                              
Integer.toString(get.getProtocolErrorCode())+"). Please report.");
+                               successfullyDownloaded = true;
+                       } else if (code == 13 /* dnd */
                            || code == 14 /* route not found */
                            || code == 20 /* jflesch is stupid */) {
                                Logger.info(this, key+" not found");


Reply via email to