mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Fix cleanup of pipe in GetObjectNInfo handlers (#6509)
This commit is contained in:
committed by
kannappanr
parent
36e51d0cee
commit
3c8fabd116
@@ -346,7 +346,10 @@ func (l *s3Objects) GetObjectNInfo(ctx context.Context, bucket, object string, r
|
||||
err := l.GetObject(ctx, bucket, object, startOffset, length, pw, objInfo.ETag, minio.ObjectOptions{})
|
||||
pw.CloseWithError(err)
|
||||
}()
|
||||
return minio.NewGetObjectReaderFromReader(pr, objInfo), nil
|
||||
// Setup cleanup function to cause the above go-routine to
|
||||
// exit in case of partial read
|
||||
pipeCloser := func() { pr.Close() }
|
||||
return minio.NewGetObjectReaderFromReader(pr, objInfo, pipeCloser), nil
|
||||
}
|
||||
|
||||
// GetObject reads an object from S3. Supports additional
|
||||
|
||||
Reference in New Issue
Block a user