diff options
author | 2023-12-05 11:46:40 +0100 | |
---|---|---|
committer | 2023-12-05 11:46:40 +0100 | |
commit | bdc43a98da7cde6a297c1e480ff6c2961c8da3e1 (patch) | |
tree | 5e83ec5554c92a3f3c2fb74e006fd9ec19fae13b /vendor/github.com/minio/minio-go/v7/api-get-object.go | |
parent | [chore]: Bump golang.org/x/crypto from 0.15.0 to 0.16.0 (#2413) (diff) | |
download | gotosocial-bdc43a98da7cde6a297c1e480ff6c2961c8da3e1.tar.xz |
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.63 to 7.0.65 (#2415)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.63 to 7.0.65.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.63...v7.0.65)
---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api-get-object.go')
-rw-r--r-- | vendor/github.com/minio/minio-go/v7/api-get-object.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api-get-object.go b/vendor/github.com/minio/minio-go/v7/api-get-object.go index e31e4cf92..9e6b1543c 100644 --- a/vendor/github.com/minio/minio-go/v7/api-get-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-get-object.go @@ -550,6 +550,8 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { } } + newOffset := o.currOffset + // Switch through whence. switch whence { default: @@ -558,12 +560,12 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { if o.objectInfo.Size > -1 && offset > o.objectInfo.Size { return 0, io.EOF } - o.currOffset = offset + newOffset = offset case 1: if o.objectInfo.Size > -1 && o.currOffset+offset > o.objectInfo.Size { return 0, io.EOF } - o.currOffset += offset + newOffset += offset case 2: // If we don't know the object size return an error for io.SeekEnd if o.objectInfo.Size < 0 { @@ -579,7 +581,7 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { if o.objectInfo.Size+offset < 0 { return 0, errInvalidArgument(fmt.Sprintf("Seeking at negative offset not allowed for %d", whence)) } - o.currOffset = o.objectInfo.Size + offset + newOffset = o.objectInfo.Size + offset } // Reset the saved error since we successfully seeked, let the Read // and ReadAt decide. @@ -587,8 +589,9 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { o.prevErr = nil } - // Ask lower level to fetch again from source - o.seekData = true + // Ask lower level to fetch again from source when necessary + o.seekData = (newOffset != o.currOffset) || o.seekData + o.currOffset = newOffset // Return the effective offset. return o.currOffset, nil |