summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-21 15:33:25 +0200
committerSimon Rettberg2021-04-21 15:33:25 +0200
commit9f7d19f2fb38fc5f2b082ed2e9bfc7dd6193b85d (patch)
tree1bed09cda81b93272c3c03506e48607b25a2859d
parent[thrift] Add allowStudentDownload to SatelliteConfig (diff)
downloadmaster-sync-shared-suite-2.0.tar.gz
master-sync-shared-suite-2.0.tar.xz
master-sync-shared-suite-2.0.zip
[Transfer] Better error messages and handling for downloadssuite-2.0
-rw-r--r--src/main/java/org/openslx/filetransfer/util/IncomingTransferBase.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/org/openslx/filetransfer/util/IncomingTransferBase.java b/src/main/java/org/openslx/filetransfer/util/IncomingTransferBase.java
index 8a69020..300a75f 100644
--- a/src/main/java/org/openslx/filetransfer/util/IncomingTransferBase.java
+++ b/src/main/java/org/openslx/filetransfer/util/IncomingTransferBase.java
@@ -389,7 +389,7 @@ public abstract class IncomingTransferBase extends AbstractTransfer implements H
currentChunk = chunks.getMissing();
} catch ( InterruptedException e ) {
Thread.currentThread().interrupt();
- cancel();
+ LOGGER.info("Incoming transfer connection was interrupted");
return null;
}
if ( currentChunk == null ) {
@@ -600,7 +600,7 @@ public abstract class IncomingTransferBase extends AbstractTransfer implements H
}
// A block finished, see if we can queue a new one
queueUnhashedChunk( false );
- if ( localCopyManager != null ) {
+ if ( localCopyManager != null && localCopyManager.isAlive() ) {
localCopyManager.trigger();
}
}
@@ -645,7 +645,7 @@ public abstract class IncomingTransferBase extends AbstractTransfer implements H
final synchronized void finishUploadInternal()
{
- if ( state == TransferState.FINISHED ) {
+ if ( state == TransferState.FINISHED || state == TransferState.ERROR ) {
return;
}
try {
@@ -659,13 +659,9 @@ public abstract class IncomingTransferBase extends AbstractTransfer implements H
if ( localCopyManager != null ) {
localCopyManager.interrupt();
}
- if ( state != TransferState.WORKING ) {
+ state = TransferState.FINISHED; // Races...
+ if ( !finishIncomingTransfer() ) {
state = TransferState.ERROR;
- } else {
- state = TransferState.FINISHED; // Races...
- if ( !finishIncomingTransfer() ) {
- state = TransferState.ERROR;
- }
}
}