Socket fix #112

wants to merge 3 commits into

1 participant


Return undefined from IO::Socket::INET.get on reaching end-of-stream and actually loop in IO::Socket::INET.lines

Also makes sure that overlong lines won't be split.


This improves upon the current situation, but does not fix all issues. In particular:

  • overlong lines will still be split even if no separator has been reached yet fixed by gerdr@dfe1eb7
  • when iterating gather/take, there's apparently some pre-fetching happening, which does not work with blocking calls
  • there's a Parrot issue which prevents the last separator to be detected until the stream has been closed fixed by parrot/parrot#943

Depending on how my question on parrot-dev turns out, the second commmit might be replaced by a parrot-side change.


Having taken another look at the code, the second commit does indeed not handle the case of split multi-character separators correctly.

A proper fix will probably end up buffering partial lines between calls to get(). I'm waiting for some answer on parrot-dev before tackling that.

@gerdr gerdr Revert "Make sure that IO::Socket::INET.get does not split overlong l…

Making sure that we actually read a whole line is now handled by Parrot.

This reverts commit dfe1eb7.

now obsolete - see #115

@gerdr gerdr closed this Mar 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment