summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver/src/main/java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/ActiveUpload.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/ActiveUpload.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/ActiveUpload.java
index dbeb24ae..49cfed56 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/ActiveUpload.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/ActiveUpload.java
@@ -7,7 +7,6 @@ import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.util.List;
-import java.util.UUID;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.log4j.Logger;
@@ -202,8 +201,10 @@ public class ActiveUpload {
}
public synchronized void cancel() {
- // TODO Auto-generated method stub
-
+ if (download != null) // TODO: Thread safety
+ download.close("Cancelled");
+ if (state != TransferState.FINISHED)
+ state = TransferState.ERROR;
}
/**
@@ -251,6 +252,8 @@ public class ActiveUpload {
if (currentChunk != null) {
// TODO: A chunk was requested before, check hash and requeue if not matching
// This needs to be async (own thread) so will be a little complicated
+ // For now, we just mark it as complete
+ chunks.markSuccessful(currentChunk);
LOGGER.info("There was a previous chunk!");
}
// Get next missing chunk