From 4af8b2d20bc8f4dcacf7248827f1f5caa9a1e701 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 27 Jul 2021 08:42:01 -0700 Subject: [PATCH] do not prematurely default multipart to 16MiB --- cmd/common-methods.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/common-methods.go b/cmd/common-methods.go index ec46bfdd..20baa630 100644 --- a/cmd/common-methods.go +++ b/cmd/common-methods.go @@ -555,9 +555,13 @@ func uploadSourceToTargetURL(ctx context.Context, urls URLs, progress io.Reader, metadata[http.CanonicalHeaderKey(k)] = v } - multipartSize, e := humanize.ParseBytes(env.Get("MC_UPLOAD_MULTIPART_SIZE", "16MiB")) - if e != nil { - return urls.WithError(probe.NewError(e)) + var e error + var multipartSize uint64 + if v := env.Get("MC_UPLOAD_MULTIPART_SIZE", ""); v != "" { + multipartSize, e = humanize.ParseBytes(v) + if e != nil { + return urls.WithError(probe.NewError(e)) + } } multipartThreads, e := strconv.Atoi(env.Get("MC_UPLOAD_MULTIPART_THREADS", "4"))