mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Revert all GetObjectNInfo related PRs (#6398)
* Revert "Encrypted reader wrapped in NewGetObjectReader should be closed (#6383)" This reverts commit53a0bbeb5b. * Revert "Change SelectAPI to use new GetObjectNInfo API (#6373)" This reverts commit5b05df215a. * Revert "Implement GetObjectNInfo object layer call (#6290)" This reverts commite6d740ce09.
This commit is contained in:
committed by
kannappanr
parent
fb27388101
commit
4487f70f08
@@ -301,27 +301,6 @@ func (l *s3Objects) ListObjectsV2(ctx context.Context, bucket, prefix, continuat
|
||||
return minio.FromMinioClientListBucketV2Result(bucket, result), nil
|
||||
}
|
||||
|
||||
func (l *s3Objects) GetObjectNInfo(ctx context.Context, bucket, object string, rs *minio.HTTPRangeSpec) (objInfo minio.ObjectInfo, reader io.ReadCloser, err error) {
|
||||
objInfo, err = l.GetObjectInfo(ctx, bucket, object)
|
||||
if err != nil {
|
||||
return objInfo, reader, err
|
||||
}
|
||||
|
||||
startOffset, length := int64(0), objInfo.Size
|
||||
if rs != nil {
|
||||
startOffset, length = rs.GetOffsetLength(objInfo.Size)
|
||||
}
|
||||
|
||||
pr, pw := io.Pipe()
|
||||
objReader := minio.NewGetObjectReader(pr, nil, nil)
|
||||
go func() {
|
||||
err := l.GetObject(ctx, bucket, object, startOffset, length, pw, objInfo.ETag)
|
||||
pw.CloseWithError(err)
|
||||
}()
|
||||
|
||||
return objInfo, objReader, nil
|
||||
}
|
||||
|
||||
// GetObject reads an object from S3. Supports additional
|
||||
// parameters like offset and length which are synonymous with
|
||||
// HTTP Range requests.
|
||||
@@ -334,9 +313,6 @@ func (l *s3Objects) GetObject(ctx context.Context, bucket string, key string, st
|
||||
}
|
||||
|
||||
opts := miniogo.GetObjectOptions{}
|
||||
if etag != "" {
|
||||
opts.SetMatchETag(etag)
|
||||
}
|
||||
if startOffset >= 0 && length >= 0 {
|
||||
if err := opts.SetRange(startOffset, startOffset+length-1); err != nil {
|
||||
logger.LogIf(ctx, err)
|
||||
|
||||
Reference in New Issue
Block a user