summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java13
1 files changed, 11 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 d071e72d..f1746697 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
@@ -65,8 +65,17 @@ public class FileServer implements IncomingEvent {
@Override
public void incomingDownloadRequest(Uploader uploader) throws IOException {
- // TODO Auto-generated method stub
-
+ String token = uploader.getToken();
+ LOGGER.info("Incoming filetransfer with token " + token);
+ ActiveDownload download = downloads.get(token);
+ if (download == null) {
+ LOGGER.warn("Unknown token " + token);
+ uploader.cancel();
+ return;
+ }
+ if (!download.addConnection(uploader, transferPool)) {
+ uploader.cancel();
+ }
}
@Override