diff options
| author | Chris Lu <chris.lu@uber.com> | 2021-04-01 02:20:00 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@uber.com> | 2021-04-01 02:20:00 -0700 |
| commit | 1f984d26453bc97c95a8aa51e69d05ac74942685 (patch) | |
| tree | ae5578554257d16edab838750cf36f2af329a835 /weed/operation/upload_content.go | |
| parent | b5880334fce31d1c4d728b2ca5c5141ef11b908a (diff) | |
| download | seaweedfs-1f984d26453bc97c95a8aa51e69d05ac74942685.tar.xz seaweedfs-1f984d26453bc97c95a8aa51e69d05ac74942685.zip | |
refactor buffer pool
Diffstat (limited to 'weed/operation/upload_content.go')
| -rw-r--r-- | weed/operation/upload_content.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 9957a04cd..e891ae03b 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -19,7 +19,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/util" - "github.com/valyala/bytebufferpool" ) type UploadResult struct { @@ -190,8 +189,8 @@ func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, i } func upload_content(uploadUrl string, fillBufferFunction func(w io.Writer) error, filename string, isGzipped bool, originalDataSize int, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (*UploadResult, error) { - buf := bytebufferpool.Get() - defer bytebufferpool.Put(buf) + buf := GetBuffer() + defer PutBuffer(buf) body_writer := multipart.NewWriter(buf) h := make(textproto.MIMEHeader) h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file"; filename="%s"`, fileNameEscaper.Replace(filename))) |
