fix: use readSizeV1 wherever applicable. (#2093)

master
Bala FA 9 years ago committed by Harshavardhana
parent 4cfbdb1bf0
commit 0540863663
  1. 2
      bucket-policy-handlers.go
  2. 2
      fs-v1-multipart.go
  3. 2
      fs-v1.go

@ -27,7 +27,7 @@ import (
) )
// maximum supported access policy size. // maximum supported access policy size.
const maxAccessPolicySize = 20 * 1024 * 1024 // 20KiB. const maxAccessPolicySize = 20 * 1024 // 20KiB.
// Verify if a given action is valid for the url path based on the // Verify if a given action is valid for the url path based on the
// existing bucket access policy. // existing bucket access policy.

@ -295,7 +295,7 @@ func (fs fsObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
md5Writer := md5.New() md5Writer := md5.New()
// Allocate 32KiB buffer for staging buffer. // Allocate 32KiB buffer for staging buffer.
var buf = make([]byte, 128*1024) var buf = make([]byte, readSizeV1)
for { for {
n, err := io.ReadFull(data, buf) n, err := io.ReadFull(data, buf)
if err == io.EOF { if err == io.EOF {

@ -323,7 +323,7 @@ func (fs fsObjects) PutObject(bucket string, object string, size int64, data io.
} }
} else { } else {
// Allocate a buffer to Read() the object upload stream. // Allocate a buffer to Read() the object upload stream.
buf := make([]byte, 32*1024) buf := make([]byte, readSizeV1)
// Read the buffer till io.EOF and append the read data to // Read the buffer till io.EOF and append the read data to
// the temporary file. // the temporary file.
for { for {

Loading…
Cancel
Save