Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Revert "volume: close request body if any parsing error"

Chris Lu359b7c165071
diff --git a/weed/storage/needle_parse_multipart.go b/weed/storage/needle_parse_multipart.go
index 93b4c2dceb..3dba81fcff 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)