|
|
|
@ -304,6 +304,7 @@ func (donut API) CreateObject(bucket, key, expectedMD5Sum string, size int64, da |
|
|
|
|
|
|
|
|
|
// createObject - PUT object to cache buffer
|
|
|
|
|
func (donut API) createObject(bucket, key, contentType, expectedMD5Sum string, size int64, data io.Reader) (ObjectMetadata, error) { |
|
|
|
|
if len(donut.config.NodeDiskMap) == 0 { |
|
|
|
|
if size > int64(donut.config.MaxSize) { |
|
|
|
|
generic := GenericObjectError{Bucket: bucket, Object: key} |
|
|
|
|
return ObjectMetadata{}, iodine.New(EntityTooLarge{ |
|
|
|
@ -312,6 +313,7 @@ func (donut API) createObject(bucket, key, contentType, expectedMD5Sum string, s |
|
|
|
|
MaxSize: strconv.FormatUint(donut.config.MaxSize, 10), |
|
|
|
|
}, nil) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if !IsValidBucket(bucket) { |
|
|
|
|
return ObjectMetadata{}, iodine.New(BucketNameInvalid{Bucket: bucket}, nil) |
|
|
|
|
} |
|
|
|
|