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 bug in ChecksumCalculatingInputStream #942

Merged
merged 1 commit into from
Dec 11, 2018
Merged

Fix bug in ChecksumCalculatingInputStream #942

merged 1 commit into from
Dec 11, 2018

Conversation

varunnvs92
Copy link
Contributor

@varunnvs92 varunnvs92 commented Dec 10, 2018

Fix #941

Bug Description
When request has content stream, UrlConnectionHttpClient copies the content stream to the connection output stream using IoUtils.copy method. The copy methods writes to the outputStream until the endOfStream is reached ie., in.read method returns -1. As ChecksumCalculatingInputStream returns 0 for eos, the copy method goes into infinite loop.

Fix: Make read method return -1 when eos is reached.

Testing
Verified the tests in reported issue passed after the change.

  • Its not possible to write tests in s3 module without adding url client module as dependency and forcing us to update all other tests to explicitly pick http client. Instead of that, I would prefer adding a module in test directory to add integ tests for S3 using UrlConnectionHttpClient. What do you think?
  • Ideally we would need tests for all InputStream classes, but its not in the scope of the PR

@spfink
Copy link
Contributor

spfink commented Dec 10, 2018

What's the background for why this is breaking?

@zoewangg
Copy link
Contributor

Can we add some tests?

@zoewangg
Copy link
Contributor

Like the idea of putting the tests in http-client-tests module.

@varunnvs92
Copy link
Contributor Author

Updated the PR with a new commit to fix dependency issues

Copy link
Contributor

@spfink spfink left a comment

Choose a reason for hiding this comment

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

LGTM still. Please rebase before pushing.

@varunnvs92 varunnvs92 merged commit 472f5bf into master Dec 11, 2018
@varunnvs92 varunnvs92 deleted the Issue941 branch December 11, 2018 17:54
aws-sdk-java-automation added a commit that referenced this pull request Aug 31, 2020
…69ec5044

Pull request: release <- staging/023b94d4-cbf1-46d6-8b24-548469ec5044
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.

3 participants