From 19f79145fc8ac04e35312e7e378679f1739227fd Mon Sep 17 00:00:00 2001 From: Tom Manville Date: Mon, 5 Aug 2013 20:50:42 -0700 Subject: [PATCH] Handle multiple of MAX_BLOCK_SIZE for Azure MPU Currently files are not properly uploaded if they are a multiple of MAX_BLOCK_SIZE. Fixes JCLOUDS-233. --- .../blobstore/strategy/AzureBlobBlockUploadStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java index dc4cb5d6d1..03b57ae50b 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/strategy/AzureBlobBlockUploadStrategy.java @@ -70,7 +70,7 @@ public class AzureBlobBlockUploadStrategy implements MultipartUploadStrategy { while (offset < length) { blockCount++; long chunkSize = MAX_BLOCK_SIZE; - if (blockCount >= totalBlocks) { + if (length - offset < MAX_BLOCK_SIZE) { chunkSize = length % MAX_BLOCK_SIZE; } bytesWritten += chunkSize;