-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure to pass the contentBody to NewRequest appropriately. #614
Conversation
8d4ac4c
to
79cb9b6
Compare
api-put-object.go
Outdated
// Initialize a new temporary buffer. | ||
tmpBuffer := new(bytes.Buffer) | ||
size, err = hashCopyN(hashAlgos, hashSums, tmpBuffer, reader, size) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, hashCopyN can return io.EOF in normal conditions (not sure why), besides, there is a check of err later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hashCopy should be io.Copy equivalent so should never return io.EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed.
api-put-object.go
Outdated
@@ -205,10 +205,13 @@ func (c Client) putObjectSingle(bucketName, objectName string, reader io.Reader, | |||
hashAlgos["sha256"] = sha256.New() | |||
} | |||
|
|||
if size <= minPartSize { | |||
if size <= minPutBufferSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was minPartSize, it means else was never entered, it could have buggy code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually let me revert this back its not needed with this patch.
c97bc52
to
d344199
Compare
This is needed since in go1.8 wrapping the body can cause content-length to be not calculated properly, which would lead to failures on the server side when uploading a zero byte object.
d344199
to
c07cfc4
Compare
Partially revert minio#614
Partially revert minio#614
Partially revert minio#614
This is needed since in go1.8 wrapping the body can cause
content-length to be not calculated properly, which would
lead to failures on the server side when uploading a zero
byte object.