From 3fb192b673699167ad4f1d044ebf1fdd3bce1483 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 28 Aug 2015 18:12:33 +0200 Subject: [server] Tweak calculation of transfer count limits --- .../src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java') 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 f821813f..a08d4e15 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 @@ -135,7 +135,7 @@ public class FileServer implements IncomingEvent { it.remove(); continue; } - activeUploads++; + activeUploads += Math.max(1, upload.getActiveConnectionCount()); } if (activeUploads > Constants.MAX_UPLOADS) { throw new TTransferRejectedException("Server busy. Too many running uploads (" + activeUploads @@ -185,7 +185,7 @@ public class FileServer implements IncomingEvent { it.remove(); continue; } - activeDownloads++; + activeDownloads += Math.max(1, download.getActiveConnectionCount()); } if (activeDownloads > Constants.MAX_DOWNLOADS) { throw new TTransferRejectedException("Server busy. Too many running uploads (" + activeDownloads -- cgit v1.2.3-55-g7522