aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-08 22:33:36 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-08 22:33:36 -0700
commit8a7327660280dfc4efe4b18b68a47eee235189fe (patch)
treeeec121d951ea1611aa677cc08df57a71360d61d3
parent006f78b70b458ca55c66f9f50692cbd9996fb5ad (diff)
downloadseaweedfs-8a7327660280dfc4efe4b18b68a47eee235189fe.tar.xz
seaweedfs-8a7327660280dfc4efe4b18b68a47eee235189fe.zip
refactor a bit
-rw-r--r--weed/operation/upload_content.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 14e0f7cd4..f6f3d0dcc 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -45,11 +45,9 @@ var fileNameEscaper = strings.NewReplacer("\\", "\\\\", "\"", "\\\"")
// Upload sends a POST request to a volume server to upload the content with adjustable compression level
func UploadData(uploadUrl string, filename string, cipher bool, data []byte, isInputGzipped bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (uploadResult *UploadResult, err error) {
- hash := md5.New()
- hash.Write(data)
uploadResult, err = doUploadData(uploadUrl, filename, cipher, data, isInputGzipped, mtype, pairMap, jwt)
if uploadResult != nil {
- uploadResult.Md5 = fmt.Sprintf("%x", hash.Sum(nil))
+ uploadResult.Md5 = util.Md5(data)
}
return
}