mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +01:00
azureblob: fix RangeOption support in Open #1825
This commit is contained in:
parent
8653944a6d
commit
9c45125271
@ -854,14 +854,21 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
|
||||
for _, option := range options {
|
||||
switch x := option.(type) {
|
||||
case *fs.RangeOption:
|
||||
start, end := x.Start, x.End
|
||||
if end < 0 {
|
||||
end = 0
|
||||
}
|
||||
if start < 0 {
|
||||
start = o.size - end
|
||||
end = 0
|
||||
}
|
||||
getBlobRangeOptions.Range = &storage.BlobRange{
|
||||
Start: uint64(x.Start),
|
||||
End: uint64(x.End),
|
||||
Start: uint64(start),
|
||||
End: uint64(end),
|
||||
}
|
||||
case *fs.SeekOption:
|
||||
getBlobRangeOptions.Range = &storage.BlobRange{
|
||||
Start: uint64(x.Offset),
|
||||
End: uint64(o.size),
|
||||
}
|
||||
default:
|
||||
if option.Mandatory() {
|
||||
|
Loading…
Reference in New Issue
Block a user