Skip to content
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

client: Fix data stream len check for zero range case #692

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

cthulhu-rider
Copy link
Contributor

No description provided.

3141d39 defect. Previously, when zero
range (i.e. full payload) was requested, `client.Client` failed stream
reader returned from `ObjectRangeInit` on 1st chunk receive. This was
caused by the condition comparing number of bytes read against the
requested one. For zero case, total length is unknown, so this check
must not be done at all.

This fixes the problem and adds corresponding unit test.

Fixes #691.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.16%. Comparing base (d7ca2b4) to head (6a6f86a).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
client/object_get.go 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #692   +/-   ##
=======================================
  Coverage   55.16%   55.16%           
=======================================
  Files         166      166           
  Lines       22739    22739           
=======================================
  Hits        12545    12545           
  Misses       9924     9924           
  Partials      270      270           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roman-khimov roman-khimov merged commit 440fcb6 into master Mar 4, 2025
10 checks passed
@roman-khimov roman-khimov deleted the bugfix/client-zero-range-check branch March 4, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants