Forbid the upload of files bigger than the memory backend capacity

This commit is contained in:
Anis Elleuch committed 2015-05-28 22:07:02 +01:00
1 parent ab80057c5c
commit d360d0fec3
3 files changed
+25 -8

No files matched your search

+4 -1
View File
@@ -271,8 +271,11 @@ func (memory *memoryDriver) createObject(bucket, key, contentType, expectedMD5Su
totalLength := len(readBytes)
memory.lock.Lock()
memory.objects.Set(objectKey, readBytes)
ok := memory.objects.Set(objectKey, readBytes)
memory.lock.Unlock()
if !ok {
return "", iodine.New(drivers.InternalError{}, nil)
}
// setting up for de-allocation
readBytes = nil