Skip to content

Conversation

@singpolyma-shopify
Copy link

IO#readpartial allows for a second "outbuf" param which some streaming usages
expect, so support it here to allow using response bodies anywhere IO can be.

Comment on lines 70 to 105
buffer << outbuf while connection.readpartial(3, outbuf)
expect(buffer).to eq "1234567890"
Copy link
Member

Choose a reason for hiding this comment

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

Due to the problem above, if you will change size to 1 or 2 you will get corrupted data: 1224447790 or 12345457890 respectively.

@ixti
Copy link
Member

ixti commented Sep 22, 2020

@singpolyma-shopify thank you for the PR. I really like the proposed changes, but we need to make sure they work as expected when parser's buffer contains more data than requested size :D

@singpolyma-shopify
Copy link
Author

@ixti fixed

singpolyma-shopify and others added 2 commits August 28, 2024 19:25
IO#readpartial allows for a second "outbuf" param which some streaming usages
expect, so support it here to allow using response bodies anywhere IO can be.
@ixti ixti mentioned this pull request Aug 28, 2024
@ixti ixti force-pushed the io-like-support-outbuf branch from 8d362d7 to 07c1f39 Compare August 28, 2024 18:48
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.

2 participants