kopia lustrzana https://github.com/gaul/s3proxy
Plug leak in handleCompleteMultipartUpload
In jclouds 2.6.0 BlobStore.getBlob returns an InputStream instead of a ByteSource for the filesystem. Previously the call site leaked the former since it only consumed the BlobMetadata. Instead call BlobStore.blobMedata which does not include the payload. Fixes JCLOUDS-1626.pull/617/head
rodzic
b147909ff3
commit
ec12ae0fe5
|
@ -2253,7 +2253,7 @@ public class S3ProxyHandler {
|
||||||
PutOptions options;
|
PutOptions options;
|
||||||
if (Quirks.MULTIPART_REQUIRES_STUB.contains(getBlobStoreType(
|
if (Quirks.MULTIPART_REQUIRES_STUB.contains(getBlobStoreType(
|
||||||
blobStore))) {
|
blobStore))) {
|
||||||
metadata = blobStore.getBlob(containerName, uploadId).getMetadata();
|
metadata = blobStore.blobMetadata(containerName, uploadId);
|
||||||
BlobAccess access = blobStore.getBlobAccess(containerName,
|
BlobAccess access = blobStore.getBlobAccess(containerName,
|
||||||
uploadId);
|
uploadId);
|
||||||
options = new PutOptions().setBlobAccess(access);
|
options = new PutOptions().setBlobAccess(access);
|
||||||
|
@ -2632,6 +2632,7 @@ public class S3ProxyHandler {
|
||||||
blobName, uploadId, createFakeBlobMetadata(blobStore),
|
blobName, uploadId, createFakeBlobMetadata(blobStore),
|
||||||
new PutOptions());
|
new PutOptions());
|
||||||
|
|
||||||
|
// TODO: Blob can leak on precondition failures.
|
||||||
Blob blob = blobStore.getBlob(sourceContainerName, sourceBlobName,
|
Blob blob = blobStore.getBlob(sourceContainerName, sourceBlobName,
|
||||||
options);
|
options);
|
||||||
if (blob == null) {
|
if (blob == null) {
|
||||||
|
|
Ładowanie…
Reference in New Issue