mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
remove unused function
This commit is contained in:
parent
e3f0429859
commit
2cd00a47a5
1 changed files with 0 additions and 30 deletions
30
api.go
30
api.go
|
@ -599,36 +599,6 @@ func postImagesGetCache(srv *Server, w http.ResponseWriter, r *http.Request, var
|
|||
return nil
|
||||
}
|
||||
|
||||
func Upload(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
mr, err := req.MultipartReader()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
length := req.ContentLength
|
||||
for {
|
||||
|
||||
part, err := mr.NextPart()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
var read int64
|
||||
var p float32
|
||||
for {
|
||||
buffer := make([]byte, 100000)
|
||||
cBytes, err := part.Read(buffer)
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
read = read + int64(cBytes)
|
||||
//fmt.Printf("read: %v \n",read )
|
||||
p = float32(read) / float32(length) * 100
|
||||
fmt.Printf("progress: %v \n", p)
|
||||
os.Stdout.Write(buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func postBuild(srv *Server, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
if err := r.ParseMultipartForm(4096); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue