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

fix for "malfunction when reading CZIs with empty attachment-directory via curl_http_inputstream" #99

Merged
merged 23 commits into from
May 23, 2024

Conversation

ptahmose
Copy link
Contributor

@ptahmose ptahmose commented May 22, 2024

Description

With a CZI containing an attachment-directory-segment with zero entries, we called into the stream-object reading 0 bytes. The curl_http_inputstream object happened to throw an exception for a read-request of zero length.
The expected behavior is now documented, the curl_http_inputstream object does now tolerate a read-request for zero bytes, and where this zero-bytes-read-request was issued, it is now checked if there actually is something to be read.

Fixes #98

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

locally (with a CZI-document triggering this malfunction)

Checklist:

  • I followed the Contributing Guidelines.
  • I did a self-review.
  • I commented my code, particularly in hard-to-understand areas.
  • I updated the documentation.
  • I updated the version of libCZI following Versioning of libCZI depending on the type of change
    • Bug fix -> PATCH
    • New feature -> MINOR
    • Breaking change -> MAJOR
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@ptahmose ptahmose added the cla Contributor License Agreement sent to Admin label May 22, 2024
@ptahmose ptahmose requested review from soyers and a team May 22, 2024 19:45
@ptahmose ptahmose changed the title fix for "malfunction when reading CZIs with empty attachment-directory via curl_http_inputstream fix for "malfunction when reading CZIs with empty attachment-directory via curl_http_inputstream" May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 80.76923% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 65.99%. Comparing base (9a7503b) to head (6f396da).
Report is 1 commits behind head on main.

Files Patch % Lines
Src/libCZI/CziParse.cpp 77.27% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #99      +/-   ##
==========================================
+ Coverage   65.97%   65.99%   +0.01%     
==========================================
  Files          85       85              
  Lines       10647    10653       +6     
==========================================
+ Hits         7024     7030       +6     
  Misses       3623     3623              
Flag Coverage Δ
windows-latest 65.99% <80.76%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

m-aXimilian
m-aXimilian previously approved these changes May 23, 2024
Copy link
Contributor

@m-aXimilian m-aXimilian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I understood makes sense to me.

Src/libCZI/CziParse.cpp Outdated Show resolved Hide resolved
soyers
soyers previously approved these changes May 23, 2024
Copy link
Contributor

@soyers soyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for providing this fix so fast!

Co-authored-by: m-aXimilian <56168660+m-aXimilian@users.noreply.github.com>
@ptahmose ptahmose dismissed stale reviews from soyers and m-aXimilian via 6f396da May 23, 2024 08:18
@ptahmose ptahmose requested review from soyers and a team May 23, 2024 08:23
@ptahmose ptahmose merged commit 0c4f6c7 into ZEISS:main May 23, 2024
15 checks passed
Copy link
Contributor

@DaveyJonesBitPail DaveyJonesBitPail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Approved with a couple of questions and recommendations

.github/workflows/cmake.yml Show resolved Hide resolved
Src/libCZI/CziParse.cpp Show resolved Hide resolved
Src/libCZI/CziParse.cpp Show resolved Hide resolved
Src/libCZI/CziParse.cpp Show resolved Hide resolved
Src/libCZI/CziParse.cpp Show resolved Hide resolved
@ptahmose ptahmose deleted the jbl/#98 branch May 23, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla Contributor License Agreement sent to Admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issue with "curl_http_inputstream" (with specific CZI-documents)
4 participants