Skip to content
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

readpartial sometimes returns empty string #485

Closed
jrochkind opened this issue Jun 22, 2018 · 3 comments
Closed

readpartial sometimes returns empty string #485

jrochkind opened this issue Jun 22, 2018 · 3 comments
Labels

Comments

@jrochkind
Copy link
Contributor

jrochkind commented Jun 22, 2018

Not nil that means it's over, but the empty string. At first I thought it never did this twice in a row, but I believe it actually can.

Not totally sure if this is a bug or not -- maybe it's expected? But if I'm trying to wrap things in an "IO-like" duck-typed API, that converst read calls to readpartial on the body... some consumers that want an "IO-like" object don't ever expect read(some_bytes) to return the empty string. I don't believe ruby native IO objects ever will, for instance.

Is this a bug? And in what circumstances might readpartial return empty string?

@jrochkind
Copy link
Contributor Author

This applies to each too actually.

If I do each on a #body, sometimes it yields an empty string.

@ixti ixti added the Bug label Jun 22, 2018
@tarcieri
Copy link
Member

Could this be related to #422?

@ixti
Copy link
Member

ixti commented Feb 4, 2019

I have cut 5.0.0 pre release version of gem with switch to updated http parser. This should be fixed now.

@ixti ixti closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants