mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
rest/rclone/s3/sftp/swift: move short file detection behind feature gate
These backends tend to use a large variety of server implementations. Some of those implementations might prove problematic with the new checks.
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/restic/restic/internal/backend/util"
|
||||
"github.com/restic/restic/internal/debug"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/feature"
|
||||
|
||||
"github.com/ncw/swift/v2"
|
||||
)
|
||||
@@ -156,7 +157,7 @@ func (be *beSwift) openReader(ctx context.Context, h backend.Handle, length int,
|
||||
return nil, fmt.Errorf("conn.ObjectOpen: %w", err)
|
||||
}
|
||||
|
||||
if length > 0 {
|
||||
if feature.Flag.Enabled(feature.BackendErrorRedesign) && length > 0 {
|
||||
// get response length, but don't cause backend calls
|
||||
cctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
|
||||
Reference in New Issue
Block a user