forked from TrueCloudLab/frostfs-s3-gw
parent
0f3b4ab0ed
commit
563c1d9bd7
3 changed files with 6 additions and 6 deletions
2
api/cache/listsession.go
vendored
2
api/cache/listsession.go
vendored
|
@ -48,7 +48,7 @@ func (k *ListSessionKey) String() string {
|
||||||
|
|
||||||
// NewListSessionCache is a constructor which creates an object of ListObjectsCache with the given lifetime of entries.
|
// NewListSessionCache is a constructor which creates an object of ListObjectsCache with the given lifetime of entries.
|
||||||
func NewListSessionCache(config *Config) *ListSessionCache {
|
func NewListSessionCache(config *Config) *ListSessionCache {
|
||||||
gc := gcache.New(config.Size).LRU().Expiration(config.Lifetime).EvictedFunc(func(key interface{}, val interface{}) {
|
gc := gcache.New(config.Size).LRU().Expiration(config.Lifetime).EvictedFunc(func(_ interface{}, val interface{}) {
|
||||||
session, ok := val.(*data.ListSession)
|
session, ok := val.(*data.ListSession)
|
||||||
if !ok {
|
if !ok {
|
||||||
config.Logger.Warn(logs.InvalidCacheEntryType, zap.String("actual", fmt.Sprintf("%T", val)),
|
config.Logger.Warn(logs.InvalidCacheEntryType, zap.String("actual", fmt.Sprintf("%T", val)),
|
||||||
|
|
|
@ -129,15 +129,15 @@ func (h *handler) CopyObjectHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var dstSize uint64
|
var dstSize uint64
|
||||||
if srcSize, err := layer.GetObjectSize(srcObjInfo); err != nil {
|
srcSize, err := layer.GetObjectSize(srcObjInfo)
|
||||||
|
if err != nil {
|
||||||
h.logAndSendError(w, "failed to get source object size", reqInfo, err)
|
h.logAndSendError(w, "failed to get source object size", reqInfo, err)
|
||||||
return
|
return
|
||||||
} else if srcSize > layer.UploadMaxSize { // https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
|
} else if srcSize > layer.UploadMaxSize { // https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
|
||||||
h.logAndSendError(w, "too bid object to copy with single copy operation, use multipart upload copy instead", reqInfo, errors.GetAPIError(errors.ErrInvalidRequestLargeCopy))
|
h.logAndSendError(w, "too bid object to copy with single copy operation, use multipart upload copy instead", reqInfo, errors.GetAPIError(errors.ErrInvalidRequestLargeCopy))
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
dstSize = srcSize
|
|
||||||
}
|
}
|
||||||
|
dstSize = srcSize
|
||||||
|
|
||||||
args, err := parseCopyObjectArgs(r.Header)
|
args, err := parseCopyObjectArgs(r.Header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -180,7 +180,7 @@ func TestMultipartUploadSize(t *testing.T) {
|
||||||
equalDataSlices(t, data[partSize:], part)
|
equalDataSlices(t, data[partSize:], part)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("check correct size when part copy", func(t *testing.T) {
|
t.Run("check correct size when part copy", func(_ *testing.T) {
|
||||||
objName2 := "obj2"
|
objName2 := "obj2"
|
||||||
uploadInfo := createMultipartUpload(hc, bktName, objName2, headers)
|
uploadInfo := createMultipartUpload(hc, bktName, objName2, headers)
|
||||||
sourceCopy := bktName + "/" + objName
|
sourceCopy := bktName + "/" + objName
|
||||||
|
|
Loading…
Reference in a new issue