diff options
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.java | 7 |
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!"); |