Merge pull request #643 from harshavardhana/pr_out_fix_a_bug_for_last_part_not_being_uploaded_due_to_lack_of_short_read_error_handling

This commit is contained in:
Harshavardhana
2015-05-18 18:01:46 -07:00
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
},
{
"ImportPath": "github.com/minio/objectstorage-go",
"Rev": "e0670aef1a63a46d0dc5dc2dba2088f55b73b4b5"
"Rev": "d5c404eb7097242a4f9f8c52fd7fce15551d0317"
},
{
"ImportPath": "github.com/shiena/ansicolor",
+1 -1
View File
@@ -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")
@@ -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)
@@ -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)
+1 -1
View File
@@ -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,