Skip to content
Snippets Groups Projects
Verified Commit 8375cb34 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'f-grpc-f-value-and-unit' into f-grpc-f-int64

parents 6408498e efc5a6c4
No related branches found
No related tags found
3 merge requests!44Release 0.6,!43Merge f-GRPC-main to dev,!29Return to int64 for integer values
Pipeline #12920 passed
...@@ -37,6 +37,7 @@ public class DownloadBuffer { ...@@ -37,6 +37,7 @@ public class DownloadBuffer {
final long next_chunk_size = Math.min(unread_bytes, getChunkSize()); final long next_chunk_size = Math.min(unread_bytes, getChunkSize());
final MappedByteBuffer map = fileChannel.map(MapMode.READ_ONLY, position, next_chunk_size); final MappedByteBuffer map = fileChannel.map(MapMode.READ_ONLY, position, next_chunk_size);
fileChannel.position(position + next_chunk_size);
final FileChunk.Builder builder = FileChunk.newBuilder(); final FileChunk.Builder builder = FileChunk.newBuilder();
builder.setData(ByteString.copyFrom(map)); builder.setData(ByteString.copyFrom(map));
......
...@@ -133,10 +133,14 @@ public class FileTransmissionServiceImpl extends FileTransmissionServiceImplBase ...@@ -133,10 +133,14 @@ public class FileTransmissionServiceImpl extends FileTransmissionServiceImplBase
final FileDownloadRequest request, final FileDownloadRequest request,
final StreamObserver<FileDownloadResponse> responseObserver) { final StreamObserver<FileDownloadResponse> responseObserver) {
try { try {
final FileDownloadResponse response = FileDownloadResponse response =
fileDownloadRegistration.downloadNextChunk(request.getFileTransmissionId()); fileDownloadRegistration.downloadNextChunk(request.getFileTransmissionId());
responseObserver.onNext(response); responseObserver.onNext(response);
while (response.getStatus() == TransmissionStatus.TRANSMISSION_STATUS_GO_ON) {
response = fileDownloadRegistration.downloadNextChunk(request.getFileTransmissionId());
responseObserver.onNext(response);
}
responseObserver.onCompleted(); responseObserver.onCompleted();
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); e.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment