diff options
author | Simon Rettberg | 2015-10-02 14:53:15 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-10-02 14:53:15 +0200 |
commit | 696a5b00857b1891e1db61198f4437934d03cb85 (patch) | |
tree | c7391001bf7788ef3a51c24c294795b805ede0dc /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java | |
parent | [client] Start upload only when finishing wizard, add final summary page to w... (diff) | |
download | tutor-module-696a5b00857b1891e1db61198f4437934d03cb85.tar.gz tutor-module-696a5b00857b1891e1db61198f4437934d03cb85.tar.xz tutor-module-696a5b00857b1891e1db61198f4437934d03cb85.zip |
[server] Tweaks/fixes to file transfers
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 | 12 |
1 files changed, 7 insertions, 5 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 6053aa74..a8023989 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 @@ -139,7 +139,7 @@ public class FileServer implements IncomingEvent { continue; } if (upload.countsTowardsConnectionLimit(now)) { - activeUploads += Math.max(1, upload.getActiveConnectionCount()); + activeUploads += 1; } } if (activeUploads >= Constants.MAX_UPLOADS) { @@ -191,7 +191,7 @@ public class FileServer implements IncomingEvent { continue; } if (download.countsTowardsConnectionLimit(now)) { - activeDownloads += Math.max(1, download.getActiveConnectionCount()); + activeDownloads += 1; } } if (activeDownloads >= Constants.MAX_DOWNLOADS) { @@ -217,9 +217,11 @@ public class FileServer implements IncomingEvent { errorMessage = "File corrupted on server"; } if (errorMessage != null) { - try { - DbImage.markValid(false, true, localImageData); - } catch (SQLException e) { + if (localImageData.isValid) { + try { + DbImage.markValid(false, true, localImageData); + } catch (SQLException e) { + } } throw new TTransferRejectedException(errorMessage); } |