Merge pull request #756 from zzoe/patch-1

Update volume_server_handlers_write.go
This commit is contained in:
Chris Lu 2018-10-30 21:52:19 -07:00 committed by GitHub
commit 200cbcde62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
} }
ret := operation.UploadResult{} ret := operation.UploadResult{}
size, errorStatus := topology.ReplicatedWrite(vs.GetMaster(), _, errorStatus := topology.ReplicatedWrite(vs.GetMaster(),
vs.store, volumeId, needle, r) vs.store, volumeId, needle, r)
httpStatus := http.StatusCreated httpStatus := http.StatusCreated
if errorStatus != "" { if errorStatus != "" {
@ -44,7 +44,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
if needle.HasName() { if needle.HasName() {
ret.Name = string(needle.Name) ret.Name = string(needle.Name)
} }
ret.Size = size ret.Size = needle.DataSize
setEtag(w, needle.Etag()) setEtag(w, needle.Etag())
writeJsonQuiet(w, r, httpStatus, ret) writeJsonQuiet(w, r, httpStatus, ret)
} }