From 3e0c043a2babdbf6c6b43be1e5577f0fbeb8d7a6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 8 Dec 2021 11:45:15 +0100 Subject: [PATCH] revert changes to storage drivers --- pkg/storage/fs/owncloud/upload.go | 10 ---------- pkg/storage/fs/owncloudsql/upload.go | 10 ---------- pkg/storage/utils/decomposedfs/upload.go | 10 ---------- pkg/storage/utils/localfs/upload.go | 10 ---------- 4 files changed, 40 deletions(-) diff --git a/pkg/storage/fs/owncloud/upload.go b/pkg/storage/fs/owncloud/upload.go index 3f2f7362bf..69a48d25d8 100644 --- a/pkg/storage/fs/owncloud/upload.go +++ b/pkg/storage/fs/owncloud/upload.go @@ -223,16 +223,6 @@ func (fs *ocfs) NewUpload(ctx context.Context, info tusd.FileInfo) (upload tusd. ctx: ctx, } - if !info.SizeIsDeferred && info.Size == 0 { - log.Debug().Interface("info", info).Msg("ocfs: finishing upload for empty file") - // no need to create info file and finish directly - err := u.FinishUpload(ctx) - if err != nil { - return nil, err - } - return u, nil - } - // writeInfo creates the file by itself if necessary err = u.writeInfo() if err != nil { diff --git a/pkg/storage/fs/owncloudsql/upload.go b/pkg/storage/fs/owncloudsql/upload.go index 8ee0383941..3ebb2aeae3 100644 --- a/pkg/storage/fs/owncloudsql/upload.go +++ b/pkg/storage/fs/owncloudsql/upload.go @@ -225,16 +225,6 @@ func (fs *owncloudsqlfs) NewUpload(ctx context.Context, info tusd.FileInfo) (upl ctx: ctx, } - if !info.SizeIsDeferred && info.Size == 0 { - log.Debug().Interface("info", info).Msg("owncloudsql: finishing upload for empty file") - // no need to create info file and finish directly - err := u.FinishUpload(ctx) - if err != nil { - return nil, err - } - return u, nil - } - // writeInfo creates the file by itself if necessary err = u.writeInfo() if err != nil { diff --git a/pkg/storage/utils/decomposedfs/upload.go b/pkg/storage/utils/decomposedfs/upload.go index 42204e32b8..2ed872e6a1 100644 --- a/pkg/storage/utils/decomposedfs/upload.go +++ b/pkg/storage/utils/decomposedfs/upload.go @@ -286,16 +286,6 @@ func (fs *Decomposedfs) NewUpload(ctx context.Context, info tusd.FileInfo) (uplo ctx: ctx, } - if !info.SizeIsDeferred && info.Size == 0 { - log.Debug().Interface("info", info).Msg("Decomposedfs: finishing upload for empty file") - // no need to create info file and finish directly - err := u.FinishUpload(ctx) - if err != nil { - return nil, err - } - return u, nil - } - // writeInfo creates the file by itself if necessary err = u.writeInfo() if err != nil { diff --git a/pkg/storage/utils/localfs/upload.go b/pkg/storage/utils/localfs/upload.go index 57e4224e8d..fb91a6b358 100644 --- a/pkg/storage/utils/localfs/upload.go +++ b/pkg/storage/utils/localfs/upload.go @@ -190,16 +190,6 @@ func (fs *localfs) NewUpload(ctx context.Context, info tusd.FileInfo) (upload tu ctx: ctx, } - if !info.SizeIsDeferred && info.Size == 0 { - log.Debug().Interface("info", info).Msg("localfs: finishing upload for empty file") - // no need to create info file and finish directly - err := u.FinishUpload(ctx) - if err != nil { - return nil, err - } - return u, nil - } - // writeInfo creates the file by itself if necessary err = u.writeInfo() if err != nil {