summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
diff options
context:
space:
mode:
authorSimon Rettberg2015-07-23 17:44:59 +0200
committerSimon Rettberg2015-07-23 17:44:59 +0200
commit756fb6041a9077bd5d14ce5dd93f3584780a98af (patch)
tree76f49fb317b7d4ef46cc892783301584fb7b0237 /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
parent[client] Changed date selection in lecture create page, set text fields edita... (diff)
downloadtutor-module-756fb6041a9077bd5d14ce5dd93f3584780a98af.tar.gz
tutor-module-756fb6041a9077bd5d14ce5dd93f3584780a98af.tar.xz
tutor-module-756fb6041a9077bd5d14ce5dd93f3584780a98af.zip
[*] Adapt to ChunkList changes; [server] Support multiple connections per upload
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
index 0869612f..9895e655 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
@@ -72,7 +72,9 @@ public class FileServer implements IncomingEvent {
downloader.cancel();
return;
}
- upload.addConnection(downloader, transferPool);
+ if (!upload.addConnection(downloader, transferPool)) {
+ downloader.cancel();
+ }
}
/**
@@ -110,7 +112,8 @@ public class FileServer implements IncomingEvent {
String key = UUID.randomUUID().toString();
ActiveUpload upload;
try {
- upload = new ActiveUpload(key, owner, image, destinationFile, fileSize, sha1Sums, machineDescription);
+ upload = new ActiveUpload(key, owner, image, destinationFile, fileSize, sha1Sums,
+ machineDescription);
} catch (FileNotFoundException e) {
LOGGER.error("Could not open destination file for writing", e);
throw new TTransferRejectedException("Destination file not writable!");