-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Always write io_buffer when in "enum bodies" branch. #3113
Always write io_buffer when in "enum bodies" branch. #3113
Conversation
I have applied this patch locally and can confirm that I don't have access to the codebase where I've noticed this issue, so I can't tell if that broke something else 👀 |
Thank you for the PR. I added three tests in a commit at 1aa498d, feel free to use them. The two array body tests pass, the enum body test fails as shown below:
I also added commit 91ad03d, which has some possible changes for request.rb. When sending requests, Puma doesn't want to buffer a large amount of string data before writing to the client socket, but there is also an interest in minimizing the number of writes. This is especially true with SSL connections. The code in the commit acts the same as your code when the body is empty, but will combine the header section with the first segment of the body if it isn't empty. There are two other changes that check for Thanks again, Greg EDIT: changed the commits, as Windows Rubies 3.1 and later failed... |
Thank you @MSP-Greg! I've cherry-picked those commits onto this branch |
Thank you for all your work. |
Description
Root of the issue is that you can get into the
if chunked
branch whenbody.each
has nothing in it, so the previously populatedio_buffer
is never written to the socket.This used to be the case but was changed on #3072. I'm just moving this line back.
Closes #3112.
Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.