-
Notifications
You must be signed in to change notification settings - Fork 123
assume chunked on a stream with no length #247
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
Merged
weissi
merged 15 commits into
swift-server:master
from
artemredkin:assume_chunked_on_zero_length_stream
Jun 23, 2020
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2383b65
assume chunked on zero-length stream
artemredkin 084dee8
linux test and swift format
artemredkin d8fad2d
Merge branch 'master' into assume_chunked_on_zero_length_stream
artemredkin 83a83e9
Merge branch 'master' into assume_chunked_on_zero_length_stream
weissi 995a98b
Convenience methods for socket paths (#235)
dimitribouniol 9a431d1
wip
artemredkin eaf203e
fix flaky testContentLengthTooLongFails test (#269)
artemredkin 02b3ed9
All internal connection flow should be executed when shutting down (#…
artemredkin 9f65902
fix missing connect timeout and make tests safer (#267)
artemredkin f6f99d2
Fix doc comment for redirectConfiguration (#266)
MaxDesiatov 233f18b
Fixed an issue where redirects to socket path-based servers from any …
dimitribouniol 29dc2c7
notify delegate about connect errors (#245)
artemredkin ac8b433
make all tests pass
artemredkin aad8fa6
Merge branch 'master' into assume_chunked_on_zero_length_stream
artemredkin 08c7a33
swiftformat
artemredkin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we should have a few more test cases here. Essentially we have quite a big matrix of possibilities:
nil
nil
content-length
nil
content-length
nil
transfer-encoding: chunked
nil
transfer-encoding: chunked
nil
nil
nil
nil
nil
content-length
nil
content-length
nil
transfer-encoding: chunked
nil
transfer-encoding: chunked
nil
nil
nil
I think we need to test them systematically or else we'll get more bugs here.
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.
@artemredkin should we do this in this ticket or create an issue from it? I think it's important because the code looks tricky
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.
I was planning on doing it in this issue
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.
Amazing, thank you so much!!
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.
hmm, I'm not sure some combinations are correct, for example:
but there is this bit in https://tools.ietf.org/html/rfc7230#section-3.3.2:
shouldn't this be
CL=0
?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.
And, if users sets
chunked
but withnil
body, we know there will be zero bytes, so we should default to Neither CL nor chunked for.GET
and toCL=0
for otherThere 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.
And last point is when user sets nothing but provides a body, we again can do two things:
if body length known - use CL, otherwise - chunked
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.
@artemredkin sorry, I made a number of C&P errors when building this table :). I agree with all the changes.
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.
We should only expect
chunked
if the user has told us that they have a body but they didn't tell us the length.We should set CL=0 if the user set
body: nil
UNLESS it's.GET, .HEAD, .DELETE, .CONNECT, .TRACE
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.
@weissi done!