这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(storage): omit check on MultiRangeDownloader #12342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1452,16 +1452,10 @@ func (mrd *gRPCBidiReader) reopenStream(failSpec []mrdRange) error {
return nil
}

// Add will add current range to stream.
// add will add current range to stream. The size of the range is not validated
// by add; if the client requests more bytes than are available in the object
// the server will return an error.
func (mrd *gRPCBidiReader) add(output io.Writer, offset, limit int64, callback func(int64, int64, error)) {
mrd.mu.Lock()
objectSize := mrd.objectSize
mrd.mu.Unlock()

if offset > objectSize {
callback(offset, 0, fmt.Errorf("storage: offset should not be larger than the size of object (%v)", objectSize))
return
}
if limit < 0 {
callback(offset, 0, errors.New("storage: cannot add range because the limit cannot be negative"))
return
Expand Down
Loading