|
|
@ -17,6 +17,7 @@ |
|
|
|
package main |
|
|
|
package main |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"crypto/sha256" |
|
|
|
"encoding/hex" |
|
|
|
"encoding/hex" |
|
|
|
"encoding/xml" |
|
|
|
"encoding/xml" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
@ -29,8 +30,6 @@ import ( |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
fastSha256 "github.com/minio/minio/pkg/crypto/sha256" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mux "github.com/gorilla/mux" |
|
|
|
mux "github.com/gorilla/mux" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -574,7 +573,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
|
|
|
|
|
|
|
|
// Start writing in a routine.
|
|
|
|
// Start writing in a routine.
|
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
shaWriter := fastSha256.New() |
|
|
|
shaWriter := sha256.New() |
|
|
|
multiWriter := io.MultiWriter(shaWriter, writer) |
|
|
|
multiWriter := io.MultiWriter(shaWriter, writer) |
|
|
|
if _, cerr := io.CopyN(multiWriter, r.Body, size); cerr != nil { |
|
|
|
if _, cerr := io.CopyN(multiWriter, r.Body, size); cerr != nil { |
|
|
|
errorIf(cerr, "Unable to read HTTP body.", nil) |
|
|
|
errorIf(cerr, "Unable to read HTTP body.", nil) |
|
|
@ -719,7 +718,7 @@ func (api objectAPIHandlers) PutObjectPartHandler(w http.ResponseWriter, r *http |
|
|
|
|
|
|
|
|
|
|
|
// Start writing in a routine.
|
|
|
|
// Start writing in a routine.
|
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
shaWriter := fastSha256.New() |
|
|
|
shaWriter := sha256.New() |
|
|
|
multiWriter := io.MultiWriter(shaWriter, writer) |
|
|
|
multiWriter := io.MultiWriter(shaWriter, writer) |
|
|
|
if _, err = io.CopyN(multiWriter, r.Body, size); err != nil { |
|
|
|
if _, err = io.CopyN(multiWriter, r.Body, size); err != nil { |
|
|
|
errorIf(err, "Unable to read HTTP body.", nil) |
|
|
|
errorIf(err, "Unable to read HTTP body.", nil) |
|
|
|