-
Notifications
You must be signed in to change notification settings - Fork 62
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 Content is larger than the available bytes in the stream #138
Conversation
Codecov Report
@@ Coverage Diff @@
## master #138 +/- ##
============================================
+ Coverage 93.61% 93.64% +0.03%
- Complexity 256 257 +1
============================================
Files 15 15
Lines 830 834 +4
============================================
+ Hits 777 781 +4
Misses 53 53
Continue to review full report at Codecov.
|
5e40b2a
to
943e6c4
Compare
Thx for the PR. Did you verify this fixes the reported owncloud problems? |
I would interpret the mismatch between When user is requesting a larger range than expected, the server need to return |
The previous code never checked the return value of The problem is seen when an old version of a file in restored and the old version was shorter in length. When we ask for the file from S3, it tells that the length is the (longer) length of what was the "current" file. But the actual file data is correctly the shorter length of the restored version. Now the question is what to do when |
This code does fix the CPU loop problem observed in ownCloud tests. |
And then someone can think through exactly what exception to throw and whether such a change in behaviour is a patch, minor or major version break. |
Merging because it fixes a bc break .. whether this is the correct behavior or not can be discussed and fixed in the next major release |
Thank you guys for working on the problem. Very appreciated |
No problem - we use this, so happy to help! |
|
Fix for sending response of ranged streams when the content length provided is larger than the total number of bytes remaining in the stream.
In such cases the operation completes successfully but the loop never exits as
stream_copy_to_stream()
returns negative value.This PR fixes this by checking the return value of
stream_copy_to_stream()
and returning when the return value is negative.