-
Notifications
You must be signed in to change notification settings - Fork 872
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
Fix return value of DownloadBuffer when HTTPRange count is less than data length #24111
base: main
Are you sure you want to change the base?
Conversation
Thank you for your contribution @ashruti-msft! We will review the pull request and get back to you soon. |
@ashruti-msft Thanks for the fix! :) |
sdk/storage/azblob/blob/client.go
Outdated
err = body.Close() | ||
return err | ||
}, | ||
}) | ||
if err != nil { | ||
return 0, err | ||
} | ||
return count, nil | ||
return min(dataLength, count), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering, why do we need to take the min
of dataLength & count and not just returning dataLength
?
looking at this seems like it is possible to ask for count
and still download much more bytes then requested - if that's the case it sound like another bug that is worth solving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Datalength actually is the property of the blob which shows the full size its not related to what count was given by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we shall be returning the number of bytes returned back by server as part of responses, as the data might be partial and not the full range we requested.
API change check API changes are not detected in this pull request. |
Fixes Bug #23884