Author: jflesch
Date: 2008-01-06 16:53:08 +0000 (Sun, 06 Jan 2008)
New Revision: 16941
Modified:
trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
Log:
MiniFrost : when a message download ends on a GetFailed code = 21 or code = 28,
consider the slot as invalid (Note : I hope that considering code = 28 as
invalid won't make any troubles)
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java 2008-01-06 13:08:43 UTC
(rev 16940)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java 2008-01-06 16:53:08 UTC
(rev 16941)
@@ -32,7 +32,7 @@
private boolean reliable = false;
/* reminder to do the maths */
- public final static int NMB_REMINDERS = 60; /* one per seconde, so 1
minute here */
+ public final static int NMB_REMINDERS = 300; /* one per seconde, so 5
minutes here */
private long[] transferedBlocksPast = new long[NMB_REMINDERS];
private int currentReadCursor = 0; /* read Cursor in the *past arrays */
private int currentWriteCursor = 0; /* write Cursor in the *past arrays
*/
@@ -233,7 +233,7 @@
} else {
if (requiredBlocks <= 0) return 0;
- return (int)(transferedBlocks * 100 / requiredBlocks);
+ return (int)(transferedBlocks * 99 / requiredBlocks);
}
}
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
2008-01-06 13:08:43 UTC (rev 16940)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
2008-01-06 16:53:08 UTC (rev 16941)
@@ -95,8 +95,16 @@
if (!get.isSuccessful()) {
int code = get.getGetFailedCode();
+
+ if (get.getProtocolErrorCode() == 21 /* Too big */
+ || get.getProtocolErrorCode() == 28 /* All data
not found */) {
- if (get.getProtocolErrorCode() == 4
+ Logger.warning(this, "MiniFrost: Invalid key:
"+key);
+ successfullyDownloaded = true;
+
+ board.addInvalidSlot(date, rev);
+
+ } else if (get.getProtocolErrorCode() == 4
|| code == 20) {
Logger.warning(this, "MiniFrost: Invalid key:
"+key);
successfullyDownloaded = true;