From 29eff0ecd7665bd952cea05b440d2bffea77e57c Mon Sep 17 00:00:00 2001 From: zoe Date: Mon, 29 Oct 2018 21:05:51 +0800 Subject: [PATCH 1/2] Update volume_server_handlers_write.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 返回实际文件大小,而不是needle的大小 --- weed/server/volume_server_handlers_write.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index 790d109cf..43936206e 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -44,7 +44,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) { if needle.HasName() { ret.Name = string(needle.Name) } - ret.Size = size + ret.Size = needle.DataSize setEtag(w, needle.Etag()) writeJsonQuiet(w, r, httpStatus, ret) } From a11c28cb4c267550c349899657975b002d280c3d Mon Sep 17 00:00:00 2001 From: zoe Date: Wed, 31 Oct 2018 09:36:32 +0800 Subject: [PATCH 2/2] Update volume_server_handlers_write.go size declared and not used --- weed/server/volume_server_handlers_write.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index 43936206e..f1a7dd930 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -34,7 +34,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) { } ret := operation.UploadResult{} - size, errorStatus := topology.ReplicatedWrite(vs.GetMaster(), + _, errorStatus := topology.ReplicatedWrite(vs.GetMaster(), vs.store, volumeId, needle, r) httpStatus := http.StatusCreated if errorStatus != "" {