mirror of https://github.com/apache/jclouds.git
Merge pull request #636 from andrewgaul/filesystem-transient-tolerate-oversized-ranges
Tolerate oversized ranges in getBlob
This commit is contained in:
commit
bab06133ff
|
@ -560,9 +560,12 @@ public class FilesystemAsyncBlobStore extends BaseAsyncBlobStore {
|
|||
return immediateFailedFuture(new IllegalArgumentException("illegal range: " + s));
|
||||
}
|
||||
|
||||
if (offset > last || last + 1 > data.length) {
|
||||
if (offset > last) {
|
||||
return immediateFailedFuture(new IllegalArgumentException("illegal range: " + s));
|
||||
}
|
||||
if (last + 1 > data.length) {
|
||||
last = data.length - 1;
|
||||
}
|
||||
out.write(data, offset, last - offset + 1);
|
||||
}
|
||||
ContentMetadata cmd = blob.getPayload().getContentMetadata();
|
||||
|
|
|
@ -606,9 +606,12 @@ public class TransientAsyncBlobStore extends BaseAsyncBlobStore {
|
|||
return immediateFailedFuture(new IllegalArgumentException("illegal range: " + s));
|
||||
}
|
||||
|
||||
if (offset > last || last + 1 > data.length) {
|
||||
if (offset > last) {
|
||||
return immediateFailedFuture(new IllegalArgumentException("illegal range: " + s));
|
||||
}
|
||||
if (last + 1 > data.length) {
|
||||
last = data.length - 1;
|
||||
}
|
||||
out.write(data, offset, last - offset + 1);
|
||||
}
|
||||
ContentMetadata cmd = blob.getPayload().getContentMetadata();
|
||||
|
|
Loading…
Reference in New Issue