From a9504e870bfa7657c21c6727010d3e0a20a42084 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 18 May 2015 18:00:18 -0700 Subject: [PATCH] Fix a bug for last part not being uploaded due to lack of short read error handling --- Godeps/Godeps.json | 2 +- Godeps/_workspace/src/github.com/minio/objectstorage-go/api.go | 2 +- .../minio/objectstorage-go/examples/play/put_object.go | 2 +- .../github.com/minio/objectstorage-go/examples/s3/put_object.go | 2 +- .../src/github.com/minio/objectstorage-go/multipart.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 53041105..c4805207 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -36,7 +36,7 @@ }, { "ImportPath": "github.com/minio/objectstorage-go", - "Rev": "e0670aef1a63a46d0dc5dc2dba2088f55b73b4b5" + "Rev": "d5c404eb7097242a4f9f8c52fd7fce15551d0317" }, { "ImportPath": "github.com/shiena/ansicolor", diff --git a/Godeps/_workspace/src/github.com/minio/objectstorage-go/api.go b/Godeps/_workspace/src/github.com/minio/objectstorage-go/api.go index 276db7cb..85593c7d 100644 --- a/Godeps/_workspace/src/github.com/minio/objectstorage-go/api.go +++ b/Godeps/_workspace/src/github.com/minio/objectstorage-go/api.go @@ -369,7 +369,7 @@ func (a *api) listMultipartUploadsRecursiveInRoutine(bucket, prefix string, ch c // // You must have WRITE permissions on a bucket to create an object // -// This version of CreateObject automatically does multipart for more than 5MB worth of data +// This version of PutObject automatically does multipart for more than 5MB worth of data func (a *api) PutObject(bucket, object string, size uint64, data io.Reader) error { if strings.TrimSpace(object) == "" { return errors.New("object name cannot be empty") diff --git a/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/play/put_object.go b/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/play/put_object.go index 7f1e8653..1c86d6ae 100644 --- a/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/play/put_object.go +++ b/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/play/put_object.go @@ -41,7 +41,7 @@ func main() { object.Close() log.Fatalln(err) } - uploadID, err := m.CreateObject("testbucket", "testfile", uint64(objectInfo.Size()), object) + uploadID, err := m.PutObject("testbucket", "testfile", uint64(objectInfo.Size()), object) if err != nil { object.Close() log.Fatalln(err) diff --git a/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/s3/put_object.go b/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/s3/put_object.go index 9114a038..fce00a2a 100644 --- a/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/s3/put_object.go +++ b/Godeps/_workspace/src/github.com/minio/objectstorage-go/examples/s3/put_object.go @@ -41,7 +41,7 @@ func main() { object.Close() log.Fatalln(err) } - uploadID, err := m.CreateObject("testbucket", "testfile", uint64(objectInfo.Size()), object) + uploadID, err := m.PutObject("testbucket", "testfile", uint64(objectInfo.Size()), object) if err != nil { object.Close() log.Fatalln(err) diff --git a/Godeps/_workspace/src/github.com/minio/objectstorage-go/multipart.go b/Godeps/_workspace/src/github.com/minio/objectstorage-go/multipart.go index 9a570648..817a2236 100644 --- a/Godeps/_workspace/src/github.com/minio/objectstorage-go/multipart.go +++ b/Godeps/_workspace/src/github.com/minio/objectstorage-go/multipart.go @@ -78,7 +78,7 @@ func multiPartInRoutine(reader io.Reader, chunkSize uint64, skipParts []int, ch part := make([]byte, chunkSize) n, err = io.ReadFull(reader, part) if err != nil { - if err != io.EOF { // catastrophic error + if err != io.EOF && err != io.ErrUnexpectedEOF { // catastrophic error ch <- Part{ Data: nil, Err: err,