get() stalls when called from HTTP::Easy #107

wants to merge 1 commit into from

6 participants


I am not sure if this makes any sense at all. I did run the full spec test suite. It did not break any more than usual. IO tests all passed.

This makes HTTP::Easy work as advertised (and consequently Bailador).

Rakudo Perl member

I fear this patch takes the wrong approach.

Setting the encoding of the socket is necessary to make sure that multi-byte sequences aren't torn apart. For example in UTF-16LE and BE there can be two-byte sequences starting with 0A, but with your patch the 0A would be wrongly recognized as a newline, and terminate the string returned from .get. Subsequent decoding as UTF-16{LE,BE} would fail. Parrot's readline method supposedly already has code that handles this problem.

Have you found out why the current approach does not work? If it's due to a bug in Parrot, we should report it.

(I might consider applying this patch as a last resort anyway, but I'd rather have a proper fix, if at all possible).


I agree, I thought you might say something like that. I am not sure if it's parrot fault or how to recreate there.


I did further logging - it definitely stops on this line:

   my str $line = $PIO.readline(nqp::unbox_s($!input-line-separator));

Host: localhost:3000
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.99 Safari/537.22
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: remember_user_token=BAhbB1sGaQZJIiIkMmEkMTAkOEFlRHpVbkhlRGMuSEo5TU9nOVNaLgY6BkVU--115f241404a6c3d4bbfdd1a4fed7a1873ea54ae2; remember_korisnik_token=BAhbB1sGaQZJIhlSelY5ODFhenJoOXN5eE5QeGl6WQY6BkVG--b7c4594a3f8eb77d1579789982a20c28fc48e168

Then it tries to readline again - and this is where it stops.

Rakudo Perl member

Can you please try the current rakudo code (ie without your patch) with parrot/master? There have been a few fixes to sockets. You can build a rakudo on top of parrot master with

  $ perl --gen-parrot=master && make install

in rakudo's source dir.


I get stuck on bootstraping panda

==> Bootstrapping Panda
Unable to parse expression in string; couldn't find final \"
in any FAILGOAL at src/stage2/QRegex.nqp:1084
in regex string at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex pair at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex pairlist at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex object at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex value:sym at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in any !protoregex at src/stage2/QRegex.nqp:746
in regex value at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex arraylist at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex array at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in regex TOP at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/
in method parse at src/gen/CORE.setting:10788
in sub from-json at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/
in submethod BUILD at /Users/kbojcic/dev/nuke/panda/lib/Panda/
in method BUILDALL at src/gen/CORE.setting:759
in method bless at src/gen/CORE.setting:743
in method new at src/gen/CORE.setting:728
in method new at /Users/kbojcic/dev/nuke/panda/lib/
in block at bin/panda:108

Rakudo Perl member

drKreso: this got fixed right now, please try again with rakudo HEAD.


Ok, panda thing is working.
HTTP::Easy test server - blocks exactly same way

@labster labster added the parrot label May 17, 2015
Rakudo Perl member

I'm going to tag this ticket as Parrot specific, because it seems to be related to the readline bugs noted above. And there's not enough information to otherwise reproduce the bug here. Let me know if this affects other VMs.


Since parrot is no longer is a supported VM, I'm closing this pull request.

@lizmat lizmat closed this Jun 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment