From 359b7c16507136c927a0ca42d1ade33d142fdc44 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 15 Apr 2019 21:35:12 -0700 Subject: [PATCH] Revert "volume: close request body if any parsing error" This reverts commit 59966561414997b18be3413d05c02a7eb15b6d12. --- weed/storage/needle_parse_multipart.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/weed/storage/needle_parse_multipart.go b/weed/storage/needle_parse_multipart.go index 93b4c2dce..3dba81fcf 100644 --- a/weed/storage/needle_parse_multipart.go +++ b/weed/storage/needle_parse_multipart.go @@ -3,7 +3,6 @@ package storage import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/operation" - "io" "io/ioutil" "mime" "net/http" @@ -14,12 +13,6 @@ import ( func parseMultipart(r *http.Request) ( fileName string, data []byte, mimeType string, isGzipped bool, originalDataSize int, isChunkedFile bool, e error) { - defer func() { - if e != nil && r.Body != nil { - io.Copy(ioutil.Discard, r.Body) - r.Body.Close() - } - }() form, fe := r.MultipartReader() if fe != nil { glog.V(0).Infoln("MultipartReader [ERROR]", fe)