summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-09 12:20:21 +0200
committerSimon Rettberg2019-04-09 12:20:21 +0200
commit3cf8d957b992143e6ca7f1be74c6200d09525e18 (patch)
tree52c0b38cd28e27cf3a505828436ec68449a43ad3
parent[client] Add missing null check (diff)
downloadtutor-module-3cf8d957b992143e6ca7f1be74c6200d09525e18.tar.gz
tutor-module-3cf8d957b992143e6ca7f1be74c6200d09525e18.tar.xz
tutor-module-3cf8d957b992143e6ca7f1be74c6200d09525e18.zip
[server] Prevent division by zero
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java
index aa3047af..b378b3cf 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java
@@ -403,7 +403,7 @@ public class IncomingDataTransfer extends IncomingTransferBase {
speedTimestamp = System.currentTimeMillis();
}
}
- if (diff != 0 && diff < 100000000) {
+ if (diff >= 1000 && diff < 100000000) {
// Time to evaluate the situation
long speed = bytes / (diff / 1000);
if (speed < SSC_ENABLE_THRES) {