From e12b6c030641a96ee5c7575d7f98199784a6a54b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 22 Nov 2018 13:45:29 -0800 Subject: [PATCH] add subimit count parameter related to https://github.com/chrislusf/seaweedfs/issues/631 --- weed/server/common.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/weed/server/common.go b/weed/server/common.go index f1f2e4e4f..005424f6d 100644 --- a/weed/server/common.go +++ b/weed/server/common.go @@ -99,8 +99,16 @@ func submitForClientHandler(w http.ResponseWriter, r *http.Request, masterUrl st debug("assigning file id for", fname) r.ParseForm() + count := uint64(1) + if r.FormValue("count") != "" { + count, pe = strconv.ParseUint(r.FormValue("count"), 10, 32) + if pe != nil { + writeJsonError(w, r, http.StatusBadRequest, pe) + return + } + } ar := &operation.VolumeAssignRequest{ - Count: 1, + Count: count, Replication: r.FormValue("replication"), Collection: r.FormValue("collection"), Ttl: r.FormValue("ttl"),