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
Bug Fix - MiniSSL::Socket#write - use data.byteslice(wrote..-1) #2543
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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.
@MSP-Greg Do you understand why 5.1.1 doesn't seem to have the problem stated in #2542? This line of code wasn't changed in #2519 (but surrounding code was: https://github.com/puma/puma/pull/2519/files#diff-5f9e58f45420759185f3cff5203a523482b915cc3e331bb0f060977c2078d903)
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 will look at 5.1.1 and 5.2.0. I believe the bug requires a response with multi-byte characters, longer than 16kB, and ssl. And, since some html parsers can be rather forgiving...
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.
If I'm reading the code right, I think the bug was in changing line 133 from
data.bytesize
todata
, no?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.
Confused. Do you mean changing
data.bytesize
todata_size
, which is set to the value ofdata.bytesize
?Anyway, I'm working thru it. The code in 5.1.1 was writing 512 byte chunks to the TCPSocket, which seemed not optimized. But, it also appears that it wrote all the data with
@engine.write
, where the current code is writing it in 16kB chunks. Because 5.1.1 was writing everything with@engine.write
, maybe the issues with how it was looping weren't apparent?Trying to figure out why the difference in write size is happening... Regardless, I believe the current code is a lot faster?
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 had to review the code changes in minissl.c, but I now recall. It's involved, but I'll write it up.