Author: jflesch
Date: 2006-07-11 00:55:15 +0000 (Tue, 11 Jul 2006)
New Revision: 9555
Modified:
trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/plugins/fetchPlugin/KeyFileFilter.java
Log:
Fixing transfer cancellation
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2006-07-10 23:51:46 UTC
(rev 9554)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2006-07-11 00:55:15 UTC
(rev 9555)
@@ -201,6 +201,9 @@
if(message.getMessageName().equals("GetFailed")) {
Logger.debug(this, "GetFailed !");
+ if(isPersistent())
+ removePersistent();
+
int code = ((new
Integer(message.getValue("Code"))).intValue());
attempt++;
@@ -383,26 +386,25 @@
public boolean stop(FCPQueueManager queryManager) {
Logger.info(this, "Stop fetching of the key : "+getFileKey());
- progress = 100;
- successful = false;
- status = "Stopped";
-
if(!isRunning() || isFinished()) {
Logger.info(this, "Can't stop. Not running ->
considered as failed");
setChanged();
notifyObservers();
- return true;
- }
-
- if(isPersistent()) {
- removePersistent();
} else {
- Logger.warning(this, "Can't stop a non-persistent
query, will continue in background ...");
- return false;
+
+ if(isPersistent()) {
+ removePersistent();
+ } else {
+ Logger.warning(this, "Can't stop a
non-persistent query, will continue in background ...");
+ }
}
+ progress = 100;
+ successful = false;
+ status = "Stopped";
+
setChanged();
notifyObservers();
@@ -451,6 +453,11 @@
public void setAttempt(int x) {
attempt = x;
+
+ if(x == 0) {
+ /* We suppose it's a restart */
+ progress = 0;
+ }
}
public int getMaxAttempt() {
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-07-10 23:51:46 UTC
(rev 9554)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-07-11 00:55:15 UTC
(rev 9555)
@@ -43,7 +43,7 @@
thaw.common.cancel=Cancel
thaw.common.delay=Delay
thaw.common.copyKeysToClipboard=Copy keys to clipboard
-thaw.common.forceRestart=Force restart
+thaw.common.forceRestart=Force (re)start
## Errors
thaw.error.idAlreadyUsed=Unable to connect. Our Id is already used by another
client connected to the node.
Modified: trunk/apps/Thaw/src/thaw/plugins/fetchPlugin/KeyFileFilter.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/fetchPlugin/KeyFileFilter.java
2006-07-10 23:51:46 UTC (rev 9554)
+++ trunk/apps/Thaw/src/thaw/plugins/fetchPlugin/KeyFileFilter.java
2006-07-11 00:55:15 UTC (rev 9555)
@@ -44,7 +44,7 @@
String line = null;
while((line = in.readLine()) != null) {
- String[] pieces =
line.split("[^-\\?.a-zA-Z0-9,~%@/_]");
+ String[] pieces =
line.split("[^-\\?.a-zA-Z0-9,~%@/'_]");
for(int i = 0 ; i < pieces.length ; i++) {
if(pieces[i].matches(".{3}@.*,.*"))