summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-09-17 16:30:58 +0200
committerSimon Rettberg2014-09-17 16:30:58 +0200
commita96372b61eac196bec88f3bb2ed9f7c068d8aebb (patch)
tree4e5b2e61976f58227c749b2a10443d08964fdd3c
parentMake javadoc and some cosmetic changes (diff)
downloadmasterserver-a96372b61eac196bec88f3bb2ed9f7c068d8aebb.tar.gz
masterserver-a96372b61eac196bec88f3bb2ed9f7c068d8aebb.tar.xz
masterserver-a96372b61eac196bec88f3bb2ed9f7c068d8aebb.zip
Adapt to changed method names from master-sync-shared
-rw-r--r--src/main/java/org/openslx/imagemaster/serverconnection/ConnectionHandler.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/ConnectionHandler.java b/src/main/java/org/openslx/imagemaster/serverconnection/ConnectionHandler.java
index 7fa9c4e..2faa9b9 100644
--- a/src/main/java/org/openslx/imagemaster/serverconnection/ConnectionHandler.java
+++ b/src/main/java/org/openslx/imagemaster/serverconnection/ConnectionHandler.java
@@ -124,14 +124,14 @@ public class ConnectionHandler implements IncomingEvent
// check token to identify the client
if ( !connections.containsKey( token ) ) {
uploader.sendErrorCode( "Token not accepted." );
- uploader.close();
+ uploader.close(null);
return;
}
// check if he was a downloading client
if ( connections.get( token ).type == Connection.UPLOADING ) {
uploader.sendErrorCode( "You can not download, if you are uploading." );
- uploader.close();
+ uploader.close(null);
return;
}
@@ -141,10 +141,10 @@ public class ConnectionHandler implements IncomingEvent
long actual;
for ( Integer block : blocks ) {
actual = block * Globals.blockSize;
- uploader.sendRange( actual, ( ( fileSize - actual ) < Globals.blockSize ) ? fileSize : ( block + 1 ) * Globals.blockSize );
+ uploader.prepareSendRange( actual, ( ( fileSize - actual ) < Globals.blockSize ) ? fileSize : ( block + 1 ) * Globals.blockSize );
uploader.sendFile( fileName );
}
- uploader.close();
+ uploader.close(null);
}
@@ -163,7 +163,7 @@ public class ConnectionHandler implements IncomingEvent
token = downloader.getToken();
if ( !connections.containsKey( token ) ) {
downloader.sendErrorCode( "Token not accepted." );
- downloader.close();
+ downloader.close(null);
return;
}
@@ -176,7 +176,7 @@ public class ConnectionHandler implements IncomingEvent
// check if he was a uploading client
if ( connections.get( token ).type == Connection.DOWNLOADING ) {
downloader.sendErrorCode( "You can not upload, if you are downloading." );
- downloader.close();
+ downloader.close(null);
return;
}
@@ -187,8 +187,8 @@ public class ConnectionHandler implements IncomingEvent
log.debug( "Block " + blockNumber + " was transmitted " + image.getTimesTransmitted( blockNumber ) + " time(s)." );
downloader.setOutputFilename( connections.get( token ).filepath );
- downloader.readBinary();
+ downloader.receiveBinary();
}
- downloader.close();
+ downloader.close(null);
}
}